Dot files always first in directory?

Eduardo Krell ekrell at hector.UUCP
Sat May 6 00:37:15 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.

That's because "ls" sorts the directory entries by default. The original
question was about readdir() which doesn't. Use "od" or write a small
program using opendir() and readdir() and you'll see that "." and ".."
are the first and second entries.
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell at ulysses.att.com



More information about the Comp.unix.wizards mailing list