in reply to Re: Order of files returned by readdir
in thread Order of files returned by readdir

Personally I view this as a feature - at work I deal with directories containing thousands of files, and often I want to just count them or do something else which is order-independent. So rather than use ls, which always sorts its output somehow, I've written a tiny perl script which just returns the list of files as given by readdir().

Replies are listed 'Best First'.
Re^3: Order of files returned by readdir
by Anonymous Monk on Mar 02, 2006 at 20:30 UTC
    man ls ... -f do not sort, enable -aU, disable -lst
      That's a lot more work than perl -e 'print "@{[readdir $ARGV[0]]}\n"' dir :-)