Article View: net.bugs.v7
Article #166Code to identify "compress"ed files for "file"
From: Guy Harris
Date: Tue, 03 Sep 1985 08:26
Date: Tue, 03 Sep 1985 08:26
15 lines
1060 bytes
1060 bytes
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
Technical Details
Message-ID:
<2753@sun.uucp>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!sun!guyShow Full Headers
Complete Article Headers
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: arc1-ca.pugleaf.net!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