Article 239 of unix-pc.sources: Path: tut.cis.ohio-state.edu!osu-cis!att!ihlpl!ihchk!ihtlt!kosman!magnus!mml From: mml@magnus.UUCP (Mike Levin) Newsgroups: unix-pc.sources Subject: Compressed file magic entries Message-ID: <331@magnus.UUCP> Date: 4 Nov 88 07:03:47 GMT Reply-To: mml@magnus.UUCP (Mike Levin) Distribution: na Organization: Silent Radio, Los Angeles Lines: 49 Somebody recently posted an /etc/magic file addendum to allow 'file' to recognize compressed files. That was really SLICK, but it didn't work on the unix-pc. So, I got to thinking- what could be wrong?? I finally figured it out- when dealing with 'byte' types, the unix-pc treats them as signed, and so things get all screwy. In any case, after a bit of messing around, I got the following working. Just append it onto /etc/magic, and it should do it for your system too. If somebody out there has a better one, please email it to me. Just unshar the file- it should drop into /tmp/magic. Then, use vi to simply append it to your /etc/magic file. Have fun! *----------cut here and go for it--------------------------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh '/tmp/magic' <<'END_OF_FILE' X0 short 0x1f9d compressed data X>2 byte -116 - 12 bits X>2 byte -115 - 13 bits X>2 byte -114 - 14 bits X>2 byte -113 - 15 bits X>2 byte -112 - 16 bits END_OF_FILE if test 158 -ne `wc -c <'/tmp/magic'`; then echo shar: \"'/tmp/magic'\" unpacked with wrong size! fi # end of '/tmp/magic' fi echo shar: End of shell archive. exit 0