Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!decvax!gsg!lew From: lew@gsg.UUCP (Paul Lew) Newsgroups: comp.sources.bugs Subject: Re: comp.sources.misc v05i028: /etc/magic lines for compress Summary: /etc/magic is not portable?? Message-ID: <274@gsg.UUCP> Date: 1 Nov 88 21:12:50 GMT References: <2643@nuchat.UUCP> Organization: General Systems Group, Inc., Salem, NH Lines: 35 In article <2643@nuchat.UUCP>, steve@nuchat.UUCP (Steve Nuchia) writes: > If you have a file(1) compatible with the one in sysVr3 > adding the following lines to /etc/magic will make it > recognize compressed files. I was motivated to add this > when I imported a bunch of files from BSD systems and the .Zs > all got lopped off. > > 0 short 40223 compressed data > >2 byte <0200 - %d bits > >2 byte 0214 - 12 bits > >2 byte 0215 - 13 bits > >2 byte 0220 - 16 bits > I found out on Pyramid the magic value should be represented as: 017635 instead of 40223 apparently this is yet another byte swapping problem. Maybe all the fields in /etc/magic should use byte instead of short? Otherwise, /etc/magic is not portable to other machine. Change the short to 2 bytes solve the problem: 0 byte 0037 compressed data >1 byte 0235 >2 byte <0200 - %d bits >2 byte 0214 - 12 bits >2 byte 0215 - 13 bits >2 byte 0220 - 16 bits By browsing thru the /etc/magic file on the Pyramid, I found a lot of places where long and short were used. If this file is used on other machine like Vax it probably will not work properly. Is there a portable version of /etc/magic somewhere? -- Paul Lew {oliveb,harvard,decvax}!gsg!lew (UUCP) General Systems Group, 5 Manor Parkway, Salem, NH 03079 (603) 893-1000