General TC > Programming & Scripting - Unofficial
minimalistic approach to MIME types / filetype associations
GNUser:
Hi mocore. Right, linopen used file. When I forked it, I switched to gio. In rare situations, both methods get it right but spit out slightly different variants.
You can fork tinyopen to use file if you prefer it. The only important things for tinyopen to open a file as expected are:
1. The exact MIME type that your chosen backend (file or gio) is outputting needs to appear somewhere in /usr/local/share/tinyopen/mimeapps.list
2. MIME types in section 2 of ~/.config/tinyopen.conf need to match what your backend (file or gio) is outputting
--- Quote from: mocore on October 03, 2024, 03:26:08 AM ---any hints on how to find out [how gio works]
--- End quote ---
Not at the moment. But it's an interesting question. I'll do some investigation.
GNUser:
It seems gio uses magic numbers, which is not surprising and probably the same approach that file uses. The real question is: Where is the database that gio uses to associate a magic number with a string such as text/plain?
mocore:
see also wrt libmagic ( trailofbits/polyfile )
&& https://forum.tinycorelinux.net/index.php/topic,27304.msg175790.html#msg175790
Navigation
[0] Message Index
[*] Previous page
Go to full version