Re: readdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, September 15, 2006 2:18 pm, Toby Osbourn wrote:
> I suppose my question put simply is, what is the default ordering of
> directories when PHP uses the readdir method?

Whatever order the OS decides to use.

In practice, it's whatever is convenient for that particular file system.

So FAT, NFTS, Reiser, ext2, ext3, and so on could all behave differently.

For that matter, the OS could decide to randomize them, just for fun,
if it wanted to.

> And is there anyway to
> force a
> specific ordering to the directories before PHP searches down them?

Not with just opendir/readdir.

You could use exec() with "ls" to get them in various orders.
You could walk through and make an array and then sort.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux