Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.bugs.v7,net.bugs.2bsd,net.bugs.4bsd Subject: Code to identify "compress"ed files for "file" Message-ID: <2753@sun.uucp> Date: Tue, 3-Sep-85 04:26:13 EDT Article-I.D.: sun.2753 Posted: Tue Sep 3 04:26:13 1985 Date-Received: Thu, 5-Sep-85 01:03:31 EDT Distribution: net Organization: Sun Microsystems, Inc. Lines: 15 Xref: watmath net.bugs.v7:208 net.bugs.2bsd:288 net.bugs.4bsd:1734 Here's some code to add into "file.c" somewhere before it starts scrabbling around looking for C/FORTRAN/assembler-language keywords: if (buf[0] == '\037' && buf[1] == '\235') { printf("compressed data, "); if (buf[2]&0x80) printf("block compressed, "); printf("%d bits\n", buf[2]&0x1f); goto out; } If you have "compress" on your system, this will recognize compressed files and dump some extra information about them. Guy Harris