[Top][All Lists]

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

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

From: Pádraig Brady
Subject: Re: Symlink grouping with --group-directories-first in ls
Date: Sat, 5 Jan 2019 08:16:19 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 28/12/18 00:20, Assaf Gordon wrote:
> 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 (
> Lastly,
> In the commit message, I suggest:
>     s/used/use/
> and
>    Suggested by Amin Bandali in

I updated to fix to always set check_symlink_mode with --group.
I also simplified gobble_file() a bit to unconditionally set linkmode.


Attachment: ls-group-symlinks.patch
Description: Text Data

reply via email to

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