[Top][All Lists]

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

Re: Coreutils enhancement: ls: add colorization of mountpoints

From: Dragan Simic
Subject: Re: Coreutils enhancement: ls: add colorization of mountpoints
Date: Tue, 17 Oct 2023 19:42:31 +0200

On 2023-10-17 19:05, Parke wrote:
On 10/16/23 16:50, Parke wrote:
> I am contemplating extending ls so that mountpoints can be colorized
> (via LS_COLORS).

On Tue, Oct 17, 2023 at 2:30 AM Rob Landley <> wrote:
> I'm hoping that a mountpoint can be detected by comparing the st_dev
> fields returned by calling stat() on a directory and on that
> directory's parent.

--bind mounts exist,

If bind mounts get their own st_dev device id (and they probably do?),
then they would be colored the same as mountpoints.  In my opinion,
this is expected and desired.

Regarding performing the additional stat() calls on all files, which currently aren't performed at all in ls(1), but only when $LS_COLORS tells ls(1) that they should be performed, I'm afraid that dircolors(1) would be expected to have that in the $LS_COLORS that it produces, making many users perform the stat() calls they actually don't want or need. Maybe having an additional command-line option for ls(1), which would enable the additional processing, could be an option.

It goes without saying that performing numerous stat() calls would induce a significant performance penalty, compared with the currently employed readdir() approach.

reply via email to

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