filtering file types vs. extensions

mikea mikea at MIKEA.ATH.CX
Mon Jun 23 15:18:22 IST 2003


On Mon, Jun 23, 2003 at 09:34:36AM -0400, Scott Adkins wrote:
> As opposed to running the "file" command everytime, why not suck in the
> /etc/magic file and use it?  That is all the file command really does...
> You can even provide your own version of the /etc/magic file (and allow
> a config option to be changed to use a different one if need be) so that
> you can support it on systems (like Windows) that don't have a /etc/magic
> file on hand, or has the file, but is rather weak.

The FreeBSD I'm running doesn't use /etc/magic, and I don't even
*have* one. Here's what it uses, extracted from `truss file <foo>`:

stat("/home/mikea/.magic",0xbfbffc1c)   ERR#2 'No such file or directory'
open("/usr/share/misc/magic.mgc",0x0,05001241577) = 8 (0x8)

This is FreeBSD 4.6-RELEASE.

FreeBSD 4.3 uses /usr/share/misc/magic.

FreeBSD 4.7 uses /usr/share/misc/magic.mgc.

I can't get to any Linux boxes right now.

--
Mike Andrews
mikea at mikea.ath.cx
Tired old sysadmin since 1964



More information about the MailScanner mailing list