I have gathered quite a bit of magic/offset/mime-type data here:
https://github.com/technosaurus/MIMEtype

It does the equivalent of file -m

Basically all of the mime types with magic at offset 0 (most
common offset are checked first using binary search and
memcmp,  Then offsets at 4  and 8.
All other offsets are checked in a manner similar to blkid.

There is also an alternative method to use just the file
extension.
 
I would have ported it to toybox as `file` a long time ago,
but I have a lot of really obscure formats included and
wasn't really sure which ones to omit and/or make
configurable.
 
-R,
 Brad Conroy
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to