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

How to skip network and obscure filesystems? #227

Closed
Dietr1ch opened this issue Jan 28, 2018 · 3 comments
Closed

How to skip network and obscure filesystems? #227

Dietr1ch opened this issue Jan 28, 2018 · 3 comments
Labels

Comments

@Dietr1ch
Copy link

Dietr1ch commented Jan 28, 2018

I wanted to list files from / with fd 'flac$' / and it retrieves files from network mounts, and things from /proc.

Can those be skipped?
I think that if it's desired to go through those filesystems it should be under some non-default flag, it's a sensible default like using .gitignore to prune the search space.

@sharkdp
Copy link
Owner

sharkdp commented Jan 28, 2018

Thank you for your feedback.

See #74 for a related discussion (unfortunately, the code is gone). Instead of --mount, we ended up implementing --exclude. I'm open to discuss --mount again, but in the meantime, you can use:

fd -E /proc -E /mnt/network_share 'flac$' /

Unrelated: You can/should use --extension/-e to properly search for .flac files:

fd -e flac

@Dietr1ch
Copy link
Author

Oh, maybe I should've been clearer, I'm not really looking for flac files, but working on a plugin to interactively search for files/directories to edit/cd into.

Probably looking at mount's output is the best general workaround for now. I just wanted to check that there was no single flag solution on fd's side before digging into that.

Maybe it makes sense to have a flag that sets the exclude flags properly, that would avoid adding this probably uncommon filtering into the tight loops.

Also, I noted that there's windows binaries too. I'm not sure how this maps into windows. I think it's still usual to have a single mount drive (or whatever they call C:/ D:/) and no cross mount links (it's even "hard" to create them, I remember there was no GUI), so maybe this is even less important there.

I'll try out setting the exclude flags on the plugin side first, if it goes well I'll comment on what needs to be excluded.

@sharkdp
Copy link
Owner

sharkdp commented Feb 10, 2018

Closing this for now.

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