Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
devrand
· 5y ago · 0 comments
The gem is basically a database of mime type, file extension, and magic bytes. The last two are not included in the linked iana database.
Comments
[–]
protomyth
5y ago
Where did freedesktop.org get the magic bytes? I assume (probably stupidly) that some of that has to be in a file command on some BSD.
[–]
garblegarble
5y ago
Here's what the magic bytes look like in FreeBSD, as an example I've linked to the definition of PNG. You can see it's a fair bit more complicated but it does have mime and extension data.
https://github.com/freebsd/freebsd-src/blob/master/contrib/f...