Live data from Hacker News

Show HN: A simple, fast and user-friendly alternative to find, written in Rust

github.com

31–40 of 225 posts

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#31
post #26
post #22

Earlier quoted context omitted.

xargs does have limits on input length. On some platforms they aren't terribly high. Sound like -exec is potentially coming though. Edit: Swore I had gotten ARG_MAX complaints out of xargs in the past. Replies are correct though. I'm wrong here...xargs adjusts on the fly. Perhaps long ago, or some obscure use of xargs?

> xargs does have limits on input length what?

Some versions of xargs don't respect the shell's max argument length, so on older platforms (MacOS X 10.4 sticks out in my memory) it's easy to cause xargs to try invoking with a longer command line than permitted.

This is fixed with the `-n` argument to xargs, which lets you specify the number of arguments per invocation.

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#32
post #28
post #4

My main usecase for find is not only finding files, but to do actions on them through -exec. Unless I’m missing something, that’s not supported with this tool.

I'm curious why you (or anyone) uses -exec? It's often painfully slower than piping through xargs and I find the syntax (the semicolon and braces and the required quoting/escaping) uncomfortable. I haven't used -exec in 20 years.

find ... -ok ... {} \; is easier to type than find ... -print0 | xargs -0 -p -I{} ... {}

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#34

For the benchmarks did you clear the page cache inbetween runs? It’s crazy fast and seems a little suspect

for a narrow set of usecases with cold page caches I have written ffcnt[0]. As the name says I mostly use it to count how many million files have accumulated over time in a large directory tree. It could be extended to do regex matching on filenames a la find though, I just never had the need for it.

[0] https://github.com/the8472/ffcnt

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#36
post #9
post #7

> Ignores patterns from your .gitignore, by default. Do you need to be in the current git directory for this to happen, or all git dirs that happen to be traversed? And are you using an NFA based regex engine?

It will work for all git directories that are encountered. This behavior can be disabled with the '-I' flag, if needed. fd uses Rusts regex engine ( https://github.com/rust-lang/regex ) which is based on finite automata.

I am not sure if I find that a smart default as I frequently exclude generated files from git repositories and when want to find something I do not know why I would not like to find such a file if my pattern matches it.

I would prefer to let the switch enable the .gitignore logic, but as I don't know the authors use-case, theirs might be valid too.

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#38
post #18

With the obligatory sneaky Rust advertisement in the title, my bullshit detector rings all its bells. And once more it was right.

What exactly do you think was bullshit here?

The fact that Rust is used is uninteresting, considering there's nothing special about it as it pertains to the other advertised features. "Bullshit" might be strong, but "trivia relevant only to a person interested in fomenting language flamewars" isn't a stretch.

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#39
post #28

Earlier quoted context omitted.

I'm curious why you (or anyone) uses -exec? It's often painfully slower than piping through xargs and I find the syntax (the semicolon and braces and the required quoting/escaping) uncomfortable. I haven't used -exec in 20 years.

find ... -ok ... {} \; is easier to type than find ... -print0 | xargs -0 -p -I{} ... {}

Interesting but I was asking about -exec?

Re: Show HN: A simple, fast and user-friendly alternative to find, written in Rust

#40
post #28
post #4

My main usecase for find is not only finding files, but to do actions on them through -exec. Unless I’m missing something, that’s not supported with this tool.

I'm curious why you (or anyone) uses -exec? It's often painfully slower than piping through xargs and I find the syntax (the semicolon and braces and the required quoting/escaping) uncomfortable. I haven't used -exec in 20 years.

It's not even slower (and it's safe beyond the argv limit) if you use "+" instead of the semicolon.

  find -type f -exec sed -i s/foo/bar/ {} +
This only invokes the command twice for 100k files (assuming we can pass in 64k arguments to sed)
Post reply on HN