bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #3596] Sort directories before files in "ls"


From: Eric Blake
Subject: [patch #3596] Sort directories before files in "ls"
Date: Mon, 5 Dec 2005 07:04:19 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Follow-up Comment #1, patch #3596 (project coreutils):

Several problems with the proposed patch:

No ChangeLog.  Also, your patch is incomplete without also touching NEWS and
doc/coreutils.texi, not to mention updating the testsuite.

It is big enough that you would need to assign copyright to the FSF before we
can consider it.

You did not add a corresponding long option for -e; and -e does not really
have a good mneumonic to imply what it is doing (although -d and -D are
already taken for --directories-first, and -g and -G are already taken for
--group-directories-first.  It would be nice if the long option could start
with the same letter as the proposed short option).

Your proposed patch treats directory sorts as equal with all other sorts,
meaning that there is no way to group directories first, but then sort
directories by size and files by size.  I envision this feature as
independent from --sort, that when it is enabled, directories are always
sorted first, but that then the two groups (dirs and non-dirs) can be
additionally sorted by whatever --sort option is in effect.  That also means
that in a --reverse sort, I think directories should still be listed first,
not last.

Your patch does not take into account the fact that on systems without
dirent.d_type, you will need to stat every file to ensure which files are
directories before you can meaningfully group directories first.

Your patch does not take into account what behavior should be used with
symlinks to dirs - are they grouped with directories, or with files, or does
it depend on other options (such as -L)?


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?func=detailitem&item_id=3596>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]