/bin/ls sorting bug?

Leo Bicknell bicknell at ufp.org
Mon Jun 21 13:30:04 GMT 2004


In a message written on Mon, Jun 21, 2004 at 10:16:49AM +0100, Paul Robinson wrote:
> For what it's worth the original patch looked good to me. The nanosecond 
> patch is fine too. Please, no more intimate discussion of a command line 

I'd like to put forth a different argument why the nanosecond patch
is a better patch.

While I think the particular sort order (current behavior vrs non
nano patch vrs nano patch) is largely unimportant, I think consistency
is very important.  It's quite common to do things like using diff
on the output of commands like ls (indeed, I think several of the
built in periodic scripts to this), and for that having a _reproduceable_
order is important.

Since today, for almost all users nanos is 0 there's no impact on
most of the users.  For the few users where nanos isn't 0, the
impact is that if we do the non-nanos patch now, and then at some
point in the future add the nanos patch, at that transition old and
new ls will produce different output for the nanos users.

So, if we're going to alter the output and make people look at their
diffs (or whatever) once with puzzlement, we should make sure it's
only once.

Put another way, the man page says:

     -t      Sort by time modified (most recently modified first) before sort-
             ing the operands by lexicographical order.

Since it doesn't have a resolution, if I was a nanos user and it
didn't sort by nanos, I'd be a bit annoyed.  Having -t work correctly
is the right option.  The fact that there is no way to display nanos
is a separate bug.  Don't let the existance of one bug prevent you
from fixing another one.

Note, I advocate -T display nanos.

Humm, I didn't want to debate command line options (as the parent
suggested) but I put two in my post.  Can't win 'em all.

-- 
       Leo Bicknell - bicknell at ufp.org - CCIE 3440
        PGP keys at http://www.ufp.org/~bicknell/
Read TMBG List - tmbg-list-request at tmbg.org, www.tmbg.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040621/b76b7620/attachment.bin


More information about the freebsd-hackers mailing list