Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Able to set batch size? #768

Closed
jlay79 opened this issue May 17, 2021 · 3 comments
Closed

Able to set batch size? #768

jlay79 opened this issue May 17, 2021 · 3 comments
Labels

Comments

@jlay79
Copy link

jlay79 commented May 17, 2021

What version of fd are you using?
fd 8.2.1

When using command execution it appears as though there are only two options; -x / --exec to run an external command for each of the results, and -X / --exec-batch to run the command once with all search results as arguments.

Is there a native way to specify a "batch size" to be able to specify the number of results/arguments per command? As an example, I need to run touch on 1M files and it would be great if there was something like a --batch-size argument where I could specify how many results/arguments for each touch command to avoid "argument list too long" errors.

This can, of course, be done by piping into xargs -n, but would be nice if it were native/built-in to fd.

If not already built-in, adding a "batch size" along with the existing -j / --threads option would be very powerful.

Thanks!

Edit: AWESOME tool, btw!!!

@sharkdp
Copy link
Owner

sharkdp commented May 18, 2021

Please see #410

@jlay79
Copy link
Author

jlay79 commented May 18, 2021

I missed that, thanks for the note. As far as I can tell, it looks like that feature request is for an "auto batch" size based on the platform max arg length, which would be great. The ability to have the user set the batch size manually could also be useful.
Thanks!

@sharkdp
Copy link
Owner

sharkdp commented Aug 7, 2021

closing in favor of #410. see my new comment therein. Thank you for the feedback!

@sharkdp sharkdp closed this as completed Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants