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

Display directories even if we don't have permission to enter #437

Closed
rockandska opened this issue May 7, 2019 · 6 comments
Closed

Display directories even if we don't have permission to enter #437

rockandska opened this issue May 7, 2019 · 6 comments

Comments

@rockandska
Copy link

Hi,

fd don't display directories if it can't going in it when find/ls display it

$ ls -ld /tmp/systemd-private-038f51d7f3d04e02abcb87284bf17671-rtkit-daemon.service-yF0Zn0
drwx------ 3 root root 4096 avril 23 09:16 /tmp/systemd-private-038f51d7f3d04e02abcb87284bf17671-rtkit-daemon.service-yF0Zn0
$ find /tmp 2> /dev/null | grep "/tmp/systemd-private-038f51d7f3d04e02abcb87284bf17671-rtkit-d"
/tmp/systemd-private-038f51d7f3d04e02abcb87284bf17671-rtkit-daemon.service-yF0Zn0
$ fd -a '' /tmp | grep "/tmp/systemd-private-038f51d7f3d04e02abcb87284bf17671-rtkit-d"
$

Is there any plan to allow same behaviour even if it is with an option ?

Regards,

@sharkdp
Copy link
Owner

sharkdp commented May 31, 2019

You can use the --show-errors option for this:

▶ sudo mkdir test; sudo chmod 700 test
▶ fd
▶ fd --show-errors
[fd error]: ./test: Permission denied (os error 13)

@rockandska
Copy link
Author

Hi,

I was aware that the --show-errors is able to show the directories with error related to permission, but i was expecting to see them without an error message and with the same format as normal results like find does.

@sharkdp
Copy link
Owner

sharkdp commented Jun 6, 2019

You are right. We should still show the entry for test, even if we can not enter the directory. If --show-errors is enabled in addition, fd should show the match and the error (because there could be other results within test).

@sharkdp sharkdp added bug and removed question labels Jun 6, 2019
@sharkdp sharkdp changed the title Display directories even if can't going in it Display directories even if we don't have permission to enter Jun 6, 2019
@sharkdp
Copy link
Owner

sharkdp commented Sep 17, 2019

Related? BurntSushi/ripgrep#1346 (and the fix BurntSushi/ripgrep#1365)

@sharkdp
Copy link
Owner

sharkdp commented Mar 22, 2020

Fixed by updating to the latest ignore version.

@sharkdp
Copy link
Owner

sharkdp commented Mar 22, 2020

Released in fd 7.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants