Dot files always first in directory?

Guy Harris guy at auspex.auspex.com
Sat May 6 08:50:09 AEST 1989


>After checks on our file system, I found that this assumption is PROBABLY
>correct.  However, this type of thing is EXTREMELY DANGEROUS, unless it is
>part of the definition of the directory structure (It might well be - if it
>is ignore this message and I'll be eating flames).

It's not part of the definition of the "readdir" interface, which is
what matters.  In POSIX, for example, there is no guarantee that there
will be any "." or ".." entries *at all* - while path names with "." and
".." have to work, it is not required that directory entries with those
names actually appear in directories, or that "readdir" return entries
for them.  Don't assume you'll *ever* see them when reading a directory,
if you can possibly avoid it.



More information about the Comp.unix.wizards mailing list