Dot files always first in directory?
Tom Frauenhofer
tvf at cci632.UUCP
Tue May 9 02:33:08 AEST 1989
In article <19473 at adm.BRL.MIL> mchinni at pica.army.mil (Michael J. Chinni, SMCAR-CCS-E) writes:
>> From: "Jonathan I. Kamens" <jik at athena.mit.edu>
>> It it safe to assume when writing a program which manipulates
>> directories that . and .. will always be the first two entries in a
>> directory?
>On our systems (DoD Army) we have a program which uses several files that
>begin with a "," for storage. These all apear before "." and ".." in the
>directory listings.
Were you using the sorting options on your listing commands?
Just because the listing is displayed in some order doesn't mean that the
files in that directory are laid out in that order.
BTW, I wouldn't depend on "." and ".." being the first two listings in
a directory. It may be a convention, but I fail to see how hard it would be
to just write a little extra code to skip these entries when you find them.
Thomas V. Frauenhofer ...!rutgers!rochester!cci632!ccird7!tvf
*or* ...!rochester!cci632!ccird7!frau!tvf *or* ...!rochester!rit!anna!ma!tvf1477
FRAU BBS: (716) 227-8094 2400/1200/300 baud - log in as "new" to register
More information about the Comp.unix.wizards
mailing list