-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Can fd avoid symlink cycles? #938
Comments
Are you sure it's a cycle, and it's not just slow because it is searching all of the root filesystem (
However, searching all of Probably what is really needed here, is a way to filter based on the resolved path of symlinks, but that is kind of niche use case, and certainly a somewhat subtle option to use. Also note that if you don't include the |
I understand what |
If you search |
I see, that's probably what's happening then and not cycles. |
One thing that might help is I don't think stopping when it encounters |
I encountered a similar problem. Wine's z: directory that links to / is quite common, I would not describe it as a niche use case. I use fd through fzf currently, so my workaround is to add --exclude "z:/" to all configured fzf commands, but it is not very feasible to add this to every command when using fd by itself. I think it would be nice to have an option to follow symlinks only if it does not point outside of the search's root directory. That way when searching in $HOME it would not try to traverse the full filesystem for each wine prefix. |
This is a neat idea, basically |
It seems easy to get fd to follow symlinks and get it stuck in a cycle that's hard to detect to add the right exclude.
E.g. Wine on Linux creates a symlink
~/.wine/dosdevices/z: --> /
I was looking for a config file that I knew was somewhere in my home dir in one of the hidden dirs, so I ran
fd -H -L ...
that got stuck with high CPU use.The text was updated successfully, but these errors were encountered: