logo       

Re: question about reading directory contents: msg#00203

php.tcphp

Subject: Re: question about reading directory contents

BBrazeau-/3NCOxi1wok@xxxxxxxxxxxxxxxx wrote:

When I bring this over to linux, a ls or ls-l will list the directories in the same order but when viewed on the webpage there doesn't appear to be any reason for the order of the files or directories. I've tried seeing if it had to do with modified time, size of files / directories, even the order that they were created in. In the 4 jobs that I created and then uploaded files with different sizes, in differed order it would always list the directory heading in the following
specs
coversheets
other
addenda
Plans/Structural
Plans/Title
Plans/Mechanical

Does anyone have an idea what is happening?

The Unix commands "ls" and "ls -l" sort their output alphabetically by filename by default. I would bet that the PHP readdir() function works just like the C readdir() function, and reads the entries sequentially as they occur in the directory block(s). That order is dependent on filesystem behavior. Most Unix filesystems will fill the directory in the order of file creation.

--
Chris Johnson


---------------------------------------------------------------------
To unsubscribe, e-mail: talk-unsubscribe-4zcLI8jJc/rYtjvyW6yDsg@xxxxxxxxxxxxxxxx

Please read and follow the list guidelines:
http://www.tcphp.org/mailing_list/guidelines

The tcphp.org mailing list is sponsored by pajunas interactive, inc.




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise