-
-
Notifications
You must be signed in to change notification settings - Fork 780
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
Issue error messages (eg permission denied) #311
Comments
Thank you for the feedback. I agree. We should definitely make a plan on how to deal with such errors. I'm not sure if we should always show them by default, but I agree that we should definitely show an error message if one of the explicitly given search directories can not be traversed. |
What if the errors were shown by default, but there was a flag to suppress them? |
STDOUT (File descriptor 1) gets piped to the next command if there is a pipe. For errors, there's STDERR (FD 2) which gets connected to the terminal by default, but can be redirected to
This is standard Unix design philosophy, where MS got it from. Not having errors enabled by default will raise many eyebrows without a solid reason to deviate from established practice. Not showing errors by default means that possibly matching files which can't be accessed due to permissions issues will never be highlighted. |
Hi, I am new to Rust and wanted to gain some experience by contributing to the open source community. Is this issue still there? If yes, could you give me some pointers on how to proceed with the issue? Thanks! |
Thanks for wanting to help out! I'm not a rust man, but this does look like a good starting project. The issue persists. I suggest you tag some of the others above for guidance - I can't do that this Fasthub app. |
@sharkdp Could you help me in proceeding with this issue? Any tips would be helpful! |
@psinghal20 Thank you for offering to help out! A quick disclaimer: I did initially put the "good first issue" label on this ticket, but I now realize that it's probably not the most beginner-friendly thing to work on. That being said, a good place to start would be this Lines 207 to 210 in 27caa33
where we currently silently ignore any errors by skipping to the next entry ( return ignore::WalkState::Continue ).
A really quick & dirty solution would be to add a print-statement here before returning. However, note that this part of the code runs in a parallelized way inside the "walker" threads (that do the actual work of finding files). Printing unsynchronized from these threads could potentially result in a messed-up terminal output. A better way to fix this would be to send errors via the enum WorkerResult {
Entry(PathBuf),
Error(SomeErrorType)
} that could then by used as the underlying type for the On the receiving side of the channel, we could then print the errors in a synchronized way from a single thread. |
Closed via #331 by @psinghal20. Thanks! |
Released in fd-7.2.0. |
Totally sweet!! Thanks all! :) |
If
fd
can't search a directory, there is no notification:I'd expect a
permission denied
by default.If not default (why not? that's what STDERR is for), perhaps add a switch to enable them.
The text was updated successfully, but these errors were encountered: