|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-07-21 09:45 UTC] beluc62 at hotmail dot com
[2008-07-21 16:11 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 13:00:01 2025 UTC |
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