From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 19 19:43:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FC3816A4CE; Sat, 19 Jun 2004 19:43:52 +0000 (GMT) Received: from mta06-svc.ntlworld.com (mta06-svc.ntlworld.com [62.253.162.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id B424843D1D; Sat, 19 Jun 2004 19:43:51 +0000 (GMT) (envelope-from scott@fishballoon.org) Received: from llama.fishballoon.org ([81.104.195.124]) by mta06-svc.ntlworld.comESMTP <20040619194342.FFRD9422.mta06-svc.ntlworld.com@llama.fishballoon.org>; Sat, 19 Jun 2004 20:43:42 +0100 Received: from tuatara.fishballoon.org ([192.168.1.6]) by llama.fishballoon.org with esmtp (Exim 4.34 (FreeBSD)) id 1BblkV-000LIS-Kz; Sat, 19 Jun 2004 20:43:35 +0100 Received: (from scott@localhost) by tuatara.fishballoon.org (8.12.11/8.12.11/Submit) id i5JJhZ98028797; Sat, 19 Jun 2004 20:43:35 +0100 (BST) (envelope-from scott) Date: Sat, 19 Jun 2004 20:43:35 +0100 From: Scott Mitchell To: Tim Kientzle Message-ID: <20040619194335.GD462@tuatara.fishballoon.org> References: <20040619175007.GB462@tuatara.fishballoon.org> <40D48A39.30401@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40D48A39.30401@freebsd.org> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 4.10-PRERELEASE i386 cc: freebsd-hackers@freebsd.org Subject: Re: /bin/ls sorting bug? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2004 19:43:52 -0000 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