Dot files always first in directory?

Robert Cousins rec at dg.dg.com
Tue May 9 00:47:53 AEST 1989


In article <2892 at osiris.UUCP> consult at osiris.UUCP (Unix Consultation Mailbox (Phil)) writes:
>
>That ain't no horse, it's a red herring.
>
>The order of files in a "directory listing" (using ls, which by default
>sorts everything by ASCII collating sequence before writing it to stdout)
>has nothing to do with the real order of the files in the directory.  

Actually, when one types in "ls *", the shell places all of the filenames
which match the "*" on the command line as a replacement.  It is the SHELL
which sorts them in alphabetical order.  For example, if one types
"echo *", the names of all files are listed in alphabetical order.  Note
that the shell does not automatically insert filenames which begin with
"." by convention.  It sees them, but doesn't use them unless specifically
instructed to do so.

>You
>can only force that order by writing the directory yourself, which is
>something permitted only to root and not recommended anyway.
>
>
>phil


On some versions of Unix, even this is not allowed.  Any highly secure
unix I've ever heard of will not allow directory modification to take 
place on a mounted file system.

Robert Cousins

Speaking for myself alone.



More information about the Comp.unix.wizards mailing list