Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jun 2004 20:43:35 +0100
From:      Scott Mitchell <scott+freebsd@fishballoon.org>
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: /bin/ls sorting bug?
Message-ID:  <20040619194335.GD462@tuatara.fishballoon.org>
In-Reply-To: <40D48A39.30401@freebsd.org>
References:  <20040619175007.GB462@tuatara.fishballoon.org> <40D48A39.30401@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 19, 2004 at 11:47:21AM -0700, Tim Kientzle wrote:
> Scott Mitchell wrote:
> >
> >ls(1) says that the -t option will:
> >
> >     Sort by time modified (most recently modified first) before sort-
> >     ing the operands by lexicographical order.
> >
> >... the attached patch produces the expected output.  I can commit it if 
> >there
> >are no objections.
> 
> Looks good to me.  I wonder if the time sorting should
> include the nanos field as well. (Mostly on FreeBSD,
> the nanos field is zero, but not always.)

I don't see why not, unless some standard requires the nanos to be
ignored.  That would be pretty strange though...

> Of course, sorting on the (non-displayed) nanos field
> could also produce such unexpected output as you describe.

I guess you'd want yet another option to display the full-resolution
timestamp, if you were going to sort on the whole thing.  And you'd still
want to use the name to break ties.

	Scott

-- 
===========================================================================
Scott Mitchell           | PGP Key ID | "Eagles may soar, but weasels
Cambridge, England       | 0x54B171B9 |  don't get sucked into jet engines"
scott at fishballoon.org | 0xAA775B8B |      -- Anon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040619194335.GD462>