Dot files always first in directory?

robert.k.nichols nichols at cbnewsc.ATT.COM
Fri May 5 23:49:00 AEST 1989


In article <2778 at buengc.BU.EDU> bph at buengc.bu.edu (Blair P. Houghton) writes:
...
>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.  ...

Sorry, but the horse is still very much alive.  Directory listing programs
such as "ls" will, by default, list directory entries in alphanumeric
order, which is NOT the same as the order in which the entries actually
appear in the directory.  If you want to see the actual order, use "ls -f"
which skips the sorting and shows the entries in the order they actually
appear (and will be found by readdir() or its equivalent).

>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_...

Isn't it fortunate that "rm" doesn't try to do the filename expansion
for itself?!
-- 
.sig included a no extra charge.           |  Disclaimer: My mind is my own.
Cute quotes and batteries sold separately. |
>> Bob Nichols   nichols at iexist.att.com << |



More information about the Comp.unix.wizards mailing list