ID: 45576 Updated by: [EMAIL PROTECTED] Reported By: beluc62 at hotmail dot com -Status: Open +Status: Bogus Bug Type: Directory function related Operating System: Debian PHP Version: 5.2.6 New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. See bug #27792. Previous Comments: ------------------------------------------------------------------------ [2008-07-21 09:45:07] beluc62 at hotmail dot com filers are both mounted via nfs ------------------------------------------------------------------------ [2008-07-21 09:29:04] beluc62 at hotmail dot com Description: ------------ According to the manual, "readdir" 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. Under ZFS filesystem, return is not done in the right way. tests are done under debian x86 with one zfs filer (sunOS) and one linux filer (debizn x86). Reproduce code: --------------- # mkdir temp # cd temp/ # for i in `seq 0 19`; do touch $i.txt; done <?php $dir = opendir("temp"); while (false !== ($file = readdir($dir))) { echo "$file\n"; } ?> Expected result: ---------------- . .. 0.txt 1.txt 2.txt 3.txt 4.txt 5.txt 6.txt 7.txt 8.txt 9.txt 10.txt 11.txt 12.txt 13.txt 14.txt 15.txt 16.txt 17.txt 18.txt 19.txt Actual result: -------------- . .. 0.txt 7.txt 9.txt 12.txt 15.txt 14.txt 8.txt 13.txt 6.txt 1.txt 10.txt 17.txt 19.txt 2.txt 5.txt 4.txt 18.txt 3.txt 16.txt 11.txt ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45576&edit=1