Detecting type of file in a program

Blair P. Houghton bph at buengc.BU.EDU
Sat Feb 11 09:14:36 AEST 1989


In article <949 at auspex.UUCP> guy at auspex.UUCP (Guy Harris) writes:
>
>Note, of course, that:
>
>	1) the set of known magic numbers is not "constant" in any
>	   sense, so you have to pick a set and hope it's sufficient (or
>	   let "file" do it, if your system supports an S5-style "file",
>	   and make sure the "/etc/magic" file is up-to-date and
>	   complete);

Hokay, mah innorance is REALLY gonna show, now.

At least this is c.u.q and not c.u.w...

Just what are magic numbers for and of what significance is the /etc/magic
file.  Every once in a while I get an error saying something about bad
magic numbers or whatnot, and I usually just punt.  What's the scoop?

				--Blair
				  "Amaze your friends and coworkers:
				   alias Presto-chango 'mv -f * /bit/bucket'"



More information about the Comp.unix.questions mailing list