-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Allow "-t c" and "-t b" for block and character files on linux. #1213
Comments
What is your use case for needing those flags? |
Just scripting with the
But there is no way to filter out the directories with just fd (because cpuid and msr are character special files). |
fd is not intended to have every feature that find has. From the README:
(emphasis added)
hmm, it's actually a little surprising to me that character and block special files are excluded when you use There is some discussion of this issue in #511. I wonder if maybe it does make sense to add a new "file type" for "anything that isn't a directory". Even if you don't care about character or block devices, that could be more convenient that needing to use |
In my opinion, adding a "-t D" option will just make the "-t" option even more confusing than it currently is. My current problem with the "-t" option in general is that it is mixing filetypes with special things:
If it's okay to slightly change the commandline API, here is an alternative proposal... The existing "-S, size" option could replace "-t e" if you allow any file type to be used with "-S" (currently it looks like "-S" implies a "-t f"). Here's a tiny test to show that would work:
So, if "-S" does allow any file type, then "-t e" could just be rewritten as "-S 0b". You could go further by implying a "b" if there is no letter after the number, so "-S 0" would work too. A better way to represent "-x" would be an extra "mode" option:
So instead of "-t x", you could be more specific: "-m +100", only executable for the user. And finally, instead of "-D", maybe you could add the "!" operator to "-t" (similar to how it's already on "-o"). This assumes the "-t x" and "-t e" options no longer exist:
(Disclaimer, I haven't used windows in a decade so I don't know how this behaves on windows.) What are your thoughts? |
I personally think
I think for non-directories etc., As far as the original feature request, |
One more comment on the original request for And I now see the issue with
But that is slightly more work for the user. I'd be happy either way, as long as |
There was discussion about splitting out the empty and executable "file types" before in #823. Personally, I tend to agree that it would make more sense to have separate |
It looks like I'm pretty much alone with my opinion expressed in #823 (comment). I am inclined to agree with the opinions expressed here (#1213 (comment)). However, I would first like to see a more detailed proposal on the required (breaking) changes. And some more thought on the CLI (for example: if we want a negate-option for It will only be a few more years until we've finally come full circle and
Okay, let's do that. |
See title. Find supports both those options, but fd doesn't. Excerpt from the find man page:
Seems like fd should support these for linux systems too...
The text was updated successfully, but these errors were encountered: