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

Adding mimetype support #1344

Open
Baerbeisser opened this issue Jul 2, 2023 · 2 comments
Open

Adding mimetype support #1344

Baerbeisser opened this issue Jul 2, 2023 · 2 comments

Comments

@Baerbeisser
Copy link

Baerbeisser commented Jul 2, 2023

Like in xdg-mime query filetype some-video.webm displaying video/webm, parameters could be -M video, -m webm or something.
Would that be possible? I quess it would hurt performance.
I was always wondering, Linux Desktop is mimetype based first, file extension second. But the good old command line tools are always string only.
Have missed this feature often in find.

@xweskingx
Copy link

I'm looking to make some contributions, is this a feature that makes sense for fd? (I understand it's not trying to be a complete find replacement).

There are a couple of different approaches to listing the mime type discussed here: bojand/infer#24

I've got an example implementation that would use first attempt to get the mimetype using infer (magic number), and then falling back to the file extension database using mime_guess: xweskingx@8400b88

@sharkdp
Copy link
Owner

sharkdp commented Oct 21, 2023

To be honest, I'm rather leaning towards declining this feature request. But see #400 for a discussion on a more generic version of this.

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

3 participants