Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!husc6!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.unix.wizards Subject: Re: Dot files always first in directory? Message-ID: <2778@buengc.BU.EDU> Date: 5 May 89 10:13:37 GMT References: <11108@bloom-beacon.MIT.EDU> <3540@udccvax1.acs.udel.EDU> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.unix.wizards Organization: Boston Univ. Col. of Eng. Lines: 21 In article <3540@udccvax1.acs.udel.EDU> conan@vax1.acs.udel.EDU (Robert B Carroll) 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. To beat this horse quite dead, any leading character that would sort before the period will place the filename before the . and .. in a directory listing. The ascii characters that will do this are space, !, ", #, $, %, &, ', (, ), *, +, ,, and -. I haven't tried it, but I bet you can get the nonprinting ascii characters to do it too. There are 32 of those. I've actually had the fun ( yeah, right %-) ) task of trying to remove a file called * from a directory. It's easy, _once_you_know_how_... --Blair "...and now, with this set of Time/Life books..."