Dot files always first in directory?

Robert J Woodhead trebor at biar.UUCP
Fri May 5 14:09:46 AEST 1989


In article <11108 at bloom-beacon.MIT.EDU> jik at athena.mit.edu (Jonathan I. Kamens) writes:
>It it safe to assume when writing a program which manipulates
>directories that . and .. will always be the first two entries in a
>directory?

No.  It isn't safe to make this assumption.  Even if it is true on your
machine, it may not be on another implementation (it isn't on my Xenix
box, according to a quick test using ``l''), and it surely will be changed
_just_to_smite_your_program_ at some time in the future.

The only safe assumption to make when writing a program is that _everything_
and _everybody_ is out to get you.  Variables won't; Constant's aren't; and
Users like nothing more than to sadistically abuse your program.

-- 
Robert J Woodhead, Biar Games, Inc.  !uunet!biar!trebor | trebor at biar.UUCP
"The lamb will lie down with the lion, but the lamb won't get much sleep."
     -- Woody Allen.



More information about the Comp.unix.wizards mailing list