GNU bug report logs -
#62096
30.0.50; find-dired, dired-goto-file and spaces
Previous Next
Full log
Message #104 received at 62096 <at> debbugs.gnu.org (full text, mbox):
Manuel Giraud <manuel <at> ledu-giraud.fr> writes:
> Hi,
>
> So here is a patch that should fix *BSD and macOS. For Windows, I don't
> know if it is the right fix (so it does nothing on Windows, sorry Drew).
>
> I choose "-dgils" because FreeBSD, NetBSD and macOS man pages state the
> following about -ls switch for find(1):
> The format is identical to that produced by "ls -dgils".
>
> On OpenBSD, the find(1) man page says:
> The format is identical to that produced by "ls -dils".
>
> But the "-g" switch does not seems to do something different when the
> "-l" is present.
This is what I see on macOS:
$ find . -name "*.jpg" -ls
93775284 0 -rw-r--r-- 1 dmartin staff 0 Mar 10 18:33 ./we needed space.jpg
$ ls -dgils *.jpg
93775284 0 -rw-r--r-- 1 staff 0 Mar 10 18:33 we needed space.jpg
$ ls -dils *.jpg
93775284 0 -rw-r--r-- 1 dmartin staff 0 Mar 10 18:33 we needed space.jpg
The -g switch seems to add/remove the group column, despite the man page
saying that the switch has no effect.
As you can see, the output of find -ls on macOS really seems to match
the output of ls -dils better, which is in concordance with the OpenBSD
documentation.
>
> For testing without recompiling Emacs, one could evaluate this:
>
> (setq find-ls-option-default-ls
> (cons "-ls" (if (or (eq system-type 'berkeley-unix)
> (eq system-type 'darwin))
> "-dgils"
> "-dilsb")))
>
>
> Daniel: I'd like to hear what it does on macOS.
>
I've tested your patch and it seems to work fine on macOS. However,
users can install GNU findutils on macOS, and in those systems the bug
would still be present.
Is there a more reliable way to discern between GNU find and other find
implementations, without checking the system-type?
I know the GNU version of find supports --version, while the macOS find
returns an error, but I don't know how reliable that check would be.
This bug report was last modified 2 years and 92 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.