On 09/05/12 15:47, Graeme Geldenhuys wrote: > I know Linux (at least Gnome) uses magic numbers (first 2-4 bytes of a > file) to detect the real file type without looking at the file > extension. These magic numbers information is stored somewhere in > linux (can't remember where now), and it includes the magic number and > mime type mapping. I'll see if I can find the file I am talking about. > But as with everything Linux, this is probably highly distro specific > etc.
/usr/share/misc/magic.mgc (which on my system is a symlink to somewhere else). It's a big file: 1.8MB. Linking to libmagic will get you most the functionality of the `file` command, afaik. Henry -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
