Forum Moderators: coopster
while(false!== ($file = readdir($fp))){
echo $file;
}
However, the files are not printed out in order - they come out randomly.
In my case, all files are named the same, except they have a timestamp at the end (webcam images, every 5 minutes). So my listing comes out like: img_20070425_0300.jpg, img_20070425_1324.jpg, img_20070425_0127.jpg, etc.
I can sort the list after I'm done reading it in .. but it's very weird to me why these are coming in randomly (it just started doing this a few days ago, worked fine for months before hand).
Anyone have any ideas on what may be happening? ls shows all the files in their correct order.
Thanks!
-Sned
Returns the filename of the next file from the directory. The filenames are returned in the order in which they are stored by the filesystem.
Hope this helps
michal
Some info on linux filesystem [google.com]
Regards
Michal