Path: utzoo!attcan!uunet!bu.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!rutgers!mcnc!rti!sunpix!matthew From: matthew@sunpix.east.sun.com (Matthew Stier - Sun Visualization Products) Newsgroups: comp.unix.admin Subject: Re: /etc/magic entry for GIF files? Message-ID: <168@sunpix.East.Sun.COM> Date: 24 Oct 90 19:59:24 GMT References: <2725be7d.55aa@uop.uop.edu> Sender: news@sunpix.East.Sun.COM Organization: Sun Microsystems, Research Triangle Park, NC Lines: 34 In article <2725be7d.55aa@uop.uop.edu> nsayer@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@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 |