/etc/magic entry for GIF files?

Matthew Stier - Sun Visualization Products matthew at sunpix.east.sun.com
Thu Oct 25 05:59:24 AEST 1990


In article <2725be7d.55aa at uop.uop.edu> nsayer at uop.edu (Nick Sayer) writes:
>What I REALLY want is:
>
>0	string		GIF		GIF image
>>3	string		xxx		(version %s)
>
>but that doesn't work, obviously. Any ideas?
>

To quote the man page:


               For string values, the byte string from  the  file
               must  match  the  specified  byte string; the byte
               string from the file which is matched is the  same
               length as the specified byte string.

In other words, your 'ideal' /etc/magic' entry is looking for the character
string 'xxx'.  To fix this problem, one would have to change 'file(1)' to
have some wildcard pattern for strings.  I get around the problem with these
lines:

0       string          GIF             GIF image 
>3      string          87a             (version 87a) 
>3      string          89a             (version 89a)

These are the only two version numbers currently authorized by Compuserve.


-- 
Matthew Lee Stier    (mstier at east.Sun.COM)   |
Sun Microsystems ---  RTP, NC  27709-3447    |     "Wisconsin   Escapee"
uucp:  sun!mstier or mcnc!rti!sunpix!matthew |
phone: (919) 469-8300 fax: (919) 460-8355    |



More information about the Comp.unix.admin mailing list