something odd with the order of files in a directory (fwd)

Andreas Dilger adilger at sun.com
Fri Jan 23 22:03:18 UTC 2009


On Jan 23, 2009  10:19 +0100, Christian Kujau wrote:
> On Fri, 16 Jan 2009, Folkert van Heusden wrote:
>> I then would expect:
>> a.b
>> a.c
>> a.a
>>
>> but instead I get
>> drwxr-xr-x 3 root root 4096 2009-01-16 12:59 ..
>> -rw-r--r-- 1 root root    0 2009-01-16 12:59 a.c
>> -rw-r--r-- 1 root root    0 2009-01-16 12:59 a.b
>> -rw-r--r-- 1 root root    0 2009-01-16 12:59 a.a
>> drwxr-xr-x 2 root root 4096 2009-01-16 12:59 .
>
> Hm, is this reproducible? Which kernel, mount-options, arch?
> Here on 2.6.24/amd64 the "directory order" (GNU/ls -U resp. BSD/ls -f)
> seems to work as expected:

There is no such thing as "directory order" in Unix.  It can change at
any time, with the caveat that a single process doing a single readdir()
will get each entry existing at the start and end of readdir exactly once.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.




More information about the Ext3-users mailing list