07-29-04 10:55 PM
"music4" <music4@163.net> said:
>2. What's order of output of readdir()? It seems readdir get file entries b
y
>mtime order, but I could not find a documenation to clarify that. Is it
>true?
Order is not specified;
On "old" filesystems (so, derivatives of FFS/UFS), it was "directory order",
as directory was a simple data inode where entries had a constant size, and
each new entry was written to first unused position in the directory data.
So, the directory order was just the order in which the entries happened to
be in the directory data.
On newer filesystems (VxFS, Linux reiserfs, others) the directory structure
is some kind of hash; I guess the "directory order" there depends on the
hash scan mechanism, as no "simple" order exists any more.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
[ Post a follow-up to this message ]
|