You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use -X on a giant argument list, it fails:
$ fd /giant/directory --type f -X stat
[fd error]: Problem while executing command: Argument list too long (os error 7)
Ok, makes sense, since my argument list is 100k files long. But find -exec actually works here:
$ find . -type f -exec stat {} +
# seems to work
AFAIK the + means that all results are passed to stat, so it seems that stat actually supports argument lists that long. Or maybe find is batching them up somehow? Using find -exec + is way faster than find -exec \;, which passes them one-by-one, so it's doing something different for sure.
Would it be possible for fd to support (ridiculously) long argument lists as well?
The text was updated successfully, but these errors were encountered:
AFAIK the + means that all results are passed to stat, so it seems that stat actually supports argument lists that long. Or maybe find is batching them up somehow?
find is calling the external multiple times, if that is needed (if the argument list is too long). So yet, it's executing in batches. fd should do the same for -X.
Using find -exec + is way faster than find -exec \;, which passes them one-by-one, so it's doing something different for sure.
Exactly. -exec … + is like fds -X/--exec-batch. A normal -exec without the + is like fds -x/--exec. From my experience, -X is almost always what you want.
Counterexamples where you want -x/--exec:
Commands that only support a single filename argument
Cases where you want to profit from fds parallel command execution (e.g. long-running commands)
When I try to use
-X
on a giant argument list, it fails:Ok, makes sense, since my argument list is 100k files long. But
find -exec
actually works here:AFAIK the
+
means that all results are passed tostat
, so it seems thatstat
actually supports argument lists that long. Or maybefind
is batching them up somehow? Usingfind -exec +
is way faster thanfind -exec \;
, which passes them one-by-one, so it's doing something different for sure.Would it be possible for
fd
to support (ridiculously) long argument lists as well?The text was updated successfully, but these errors were encountered: