Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!sdcsvax!ucsdhub!sdsu!csun!csusac!unify!rk From: rk@unify.UUCP (Ron Kuris) Newsgroups: comp.unix.wizards Subject: Re: Are . and .. first? Message-ID: <749@unify.UUCP> Date: 5 May 89 20:55:47 GMT Reply-To: rk@unify.UUCP (Ron Kuris) Organization: Unify Corporation, Sacramento, CA, USA Lines: 23 In article <3540@udccvax1.acs.udel.EDU> conan@vax1.acs.udel.edu (CONAN THE BARBARIAN) writes: >In article <11108@bloom-beacon.MIT.EDU> jik@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, its not save to assume that. >try "touch #abcd" then 'list' the directory. > I did this, and then said "od -c " and lo and behold -- . and .. were first! Remember that ls sorts files before outputting them. Ron Kuris (916) 920-9092 rk@unify.UUCP {{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!rk -- Ron Kuris (916) 920-9092 rk@unify.UUCP {{ucdavis,csun,lll-crg}!csusac,pyramid,sequent}!unify!rk