From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 21 09:24:10 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 7714116A4D0; Mon, 21 Jun 2004 09:24:10 +0000 (GMT) Received: from mta03-svc.ntlworld.com (mta03-svc.ntlworld.com [62.253.162.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAA8A43D54; Mon, 21 Jun 2004 09:24:09 +0000 (GMT) (envelope-from scott@fishballoon.org) Received: from llama.fishballoon.org ([81.104.195.124]) by mta03-svc.ntlworld.comESMTP <20040621092302.NYVF28581.mta03-svc.ntlworld.com@llama.fishballoon.org>; Mon, 21 Jun 2004 10:23:02 +0100 Received: from scott by llama.fishballoon.org with local (Exim 4.34 (FreeBSD)) id 1BcL27-0001UP-QM; Mon, 21 Jun 2004 10:24:07 +0100 Date: Mon, 21 Jun 2004 10:24:07 +0100 From: Scott Mitchell To: David Malone Message-ID: <20040621092406.GA5069@llama.fishballoon.org> References: <20040621054406.GA927@VARK.homeunix.com> <200406210910.aa18808@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200406210910.aa18808@salmon.maths.tcd.ie> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 4.9-RELEASE-p4 i386 Sender: Scott Mitchell cc: freebsd-hackers@FreeBSD.ORG cc: David Schultz 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: Mon, 21 Jun 2004 09:24:10 -0000 On Mon, Jun 21, 2004 at 09:10:47AM +0100, David Malone wrote: > > Sorting on nanoseconds too is likely to be more confusing than > > useful. Even if we use one of the precious few option letters ls > > doesn't use already to add a nanosecond display, most people won't > > know about it because they don't care about nanoseconds. They > > might care when they notice---as you did---that the sort order > > isn't what they expected. > > At the moment in FreeBSD the nanoseconds field is always zero, > unless you twiddle vfs.timestamp_precision, so it would make no > difference to joe user. For people that do set vfs.timestamp_precision, > it would be nice if ls did the right thing (for example, test already > compares the nanoseconds field, after someone submitted a PR because > it didn't). I've asked the -standards people whether POSIX says anything about ls and nanoseconds. My research didn't turn up anything, but I'll let them have the final word. Given that our ls has ignored nanos for at least the last 10 years, and that it would make difference to 99% of users if it did, I don't think this is a major issue. I'm tempted to just commit the existing patch as it is, to fix the original bug, then talk about sorting on nanos, and maybe adding a new option to display them. > > Is the point of sorting on nanoseconds to totally order the files > > based on modification time? > > Depending on the clock resolution (which is partially determined > by vfs.timestamp_precision and partially determined by the actual > clock resolution), it may not be enough to totally order the files. But it (ls) would use the full resolution of the recorded timestamps to produce the displayed ordering, which is probably all you can reasonably ask of it... 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