On 10/16/23 16:50, Parke wrote: > Hello, coreutils@gnu.org, > > I am contemplating extending ls so that mountpoints can be colorized > (via LS_COLORS).
But not -F ? > 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, following symlinks with -L could get weird... > There are some related choices: Should non-directory mounts also be > colorable? You can --bind mount over a file. You can also do read only bind mounts, which are semi-invisible: $ sudo mount --bind -o,ro usb.ids usb.ids $ ls -l usb.ids -rw-r--r-- 1 landley landley 716614 May 20 2022 usb.ids $ echo >> usb.ids bash: usb.ids: Read-only file system Once upon a time you could chattr +i on ext2 to nail a file in place too (which was the only way I could get dhclient to stop replacing /etc/resolv.conf and fun things like that back in the day), and there's almost certainly other ways with selinux nonsense and similar. Nobody ever said ls showed the full story, and trying to get it to do so is both a can of worms and "now the simple posix tool exhibits complex non-obvious behavior when we ask simple questions"... Rob