Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!kth!draken!tut!santra!tukki!toivanen From: toivanen@tukki.jyu.fi (Jari Toivanen) Newsgroups: comp.unix.wizards Subject: Re: Dot files always first in directory? Message-ID: <669@tukki.jyu.fi> Date: 5 May 89 18:28:04 GMT References: <19473@adm.BRL.MIL> Reply-To: toivanen@tukki.jyu.fi (Jari Toivanen) Organization: University of Jyvaskyla, Finland Lines: 29 Expires: > From: mchinni@pica.army.mil (Michael J. Chinni, SMCAR-CCS-E) > > 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. Therefore, I would say that you cannot make you > assumption. Also, users sometimes create files (by accident) that may begin > with some of the following characters, all of which would apear before "." and > "..": ! " # $ % & ' ( ) * + , - This is already second article that says that files (or directories) which begins with character that appears before dot ('.') character appears also directory before "." and ".." entries. This is true if you use ls command or shell which expands wildcards, because they sort file names before they shows them. But if you are using directory(3) c library calls you get files in the order which they really appears in a directory. When you create a directory (in BSD or SysV) then the kernel also creates "." and ".." entries in the new directory. That's why "." and ".." entries are first ones in a directory. Also you can remove those entries only by removing the directory where they locate. So they should be first entries in a normal directory. I not sure is this true for remote file systems. I think that it's not good to presume so although it might be true almost always (if not even always). -- Jari Toivanen Segments are for worms ;-) Math student at Internet: toivanen@tukki.jyu.fi University of Jyvaskyla, Finland Bitnet: toivanen_jar@finjyu.bitnet