On Sat, Jun 19, 2004 at 10:06:01PM +0200, Dimitry Andric wrote:
> 
> Looking through ls source shows that the sorting is done by passing a
> comparison function to fts_open(3).  In the case of sorting by
> modification time, the *only* comparison made is of the mtime fields:

You did see the patch attached to my original post, right?  It modifies all
of these comparison functions to sort the two items by name (or reverse
name) in the case that their timestamps are equal.

> Note also that the fts(3) functions use qsort(3), which isn't stable,
> so you will not always get the order in which these entries are listed
> in the directory itself.

Indeed.  The proposed change will always give you a predictable ordering
for a given set of entries.

        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
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to