From:             beluc62 at hotmail dot com
Operating system: Debian
PHP version:      5.2.6
PHP Bug Type:     Directory function related
Bug description:  readdir with zfs filer

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 bug report at http://bugs.php.net/?id=45576&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45576&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45576&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45576&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45576&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45576&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45576&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45576&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45576&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45576&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45576&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45576&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45576&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45576&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45576&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45576&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45576&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45576&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45576&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45576&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45576&r=mysqlcfg

Reply via email to