coreutils
[Top][All Lists]
Advanced

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

Re: Symlink grouping with --group-directories-first in ls


From: Assaf Gordon
Subject: Re: Symlink grouping with --group-directories-first in ls
Date: Fri, 28 Dec 2018 01:20:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0

Hello Pádraig,

On 2018-12-27 7:37 a.m., Pádraig Brady wrote:
On 23/12/18 19:35, Amin Bandali wrote:

It would be great if ls had an option to group directory symlinks with
the real directories when --group-directories-first is specified.

Good point.
It probably should just do that with no other options.
The attached implements that.


A cursory test seem to indicate this doesn't work on Free/OpenBSDs
(but works well on Debian).

On BSDs, inside "is_linked_directoccry", when visiting a
symlink-to-direcotory, f->filetype=6 (which is symlink), but
f->linkmode is zero, so S_ISDIR(f->linkmode) returns false.

When adding "-L" (dereference symlinks), it works as expected
(but in such cases, f->filetype=3, not 6).

I'm happy to test more on BSDs if needed, and also my BSD virtual
machines are now in the gcc-compile-farm making testing even
easier (https://cfarm.tetaneutral.net/machines/list/).

Lastly,

In the commit message, I suggest:
   s/used/use/
and
  Suggested by Amin Bandali in
  https://lists.gnu.org/r/coreutils/2018-12/msg00017.html

regards,
 - assaf



reply via email to

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