Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm a little surprised that that link doesn't go to libmagic[1]. No doubt XDG_MIME is an important spec for desktop file detection, but I think libmagic and the magic database that underpins it are more fundamental to filetype detection in general.

It's also one of my favorite oddities on Linux. If you're a Windows user the idea of a database of signatures for filetypes that exists outside the application that "owns" a file type is novel and weird.

[1]: https://man7.org/linux/man-pages/man3/libmagic.3.html



libmagic maintains its own separate database from xdg. XDG db is meant from the ground up to have other apps add to it etc… so that one is the one apps use as a library usually, if they want to integrate nicely and correctly with other installed apps. libmagic is the hacking of the two :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: