README revision 110949
1** README for file(1) Command **
2@(#) $Id: README,v 1.28 2003/02/08 18:35:36 christos Exp $
3
4This is Release 3.x of Ian Darwin's (copyright but distributable)
5file(1) command. This version is the standard "file" command for Linux,
6*BSD, and other systems. (See "patchlevel.h" for the exact release number).
7
8UNIX is a trademark of UNIX System Laboratories.
9
10The prime contributor to Release 3.8 was Guy Harris, who put in megachanges
11including byte-order independence.
12
13The prime contributor to Release 3.0 was Christos Zoulas, who put
14in hundreds of lines of source code changes, including his own
15ANSIfication of the code (I liked my own ANSIfication better, but
16his (__P()) is the "Berkeley standard" way of doing it, and I wanted UCB
17to include the code...), his HP-like "indirection" (a feature of
18the HP file command, I think), and his mods that finally got the
19uncompress (-z) mode finished and working.
20
21This release has compiled in numerous environments; see PORTING
22for a list and problems.
23
24This fine freeware file(1) follows the USG (System V) model of the file
25command, rather than the Research (V7) version or the V7-derived 4.[23]
26Berkeley one. That is, the file /etc/magic contains much of the ritual
27information that is the source of this program's power. My version
28knows a little more magic (including tar archives) than System V; the
29/etc/magic parsing seems to be compatible with the (poorly documented)
30System V /etc/magic format (with one exception; see the man page).
31
32In addition, the /etc/magic file is built from a subdirectory
33for easier(?) maintenance.  I will act as a clearinghouse for
34magic numbers assigned to all sorts of data files that
35are in reasonable circulation. Send your magic numbers,
36in magic(4) format please, to the maintainer, Christos Zoulas.
37
38LEGAL.NOTICE - read this first.
39README - read this second (you are currently reading this file).
40PORTING - read this only if the program won't compile.
41Makefile - read this next, adapt it as needed (particularly
42	the location of the old existing file command and
43	the man page layouts), type "make" to compile, 
44	"make try" to try it out against your old version.
45	Expect some diffs, particularly since your original
46	file(1) may not grok the embedded-space ("\ ") in
47	the current magic file, or may even not use the
48	magic file.
49apprentice.c - parses /etc/magic to learn magic
50ascmagic.c - third & last set of tests, based on hardwired assumptions.
51core - not included in distribution due to mailer limitations.
52debug.c - includes -c printout routine
53file.1 - man page for the command
54magic.4 - man page for the magic file, courtesy Guy Harris.
55	Install as magic.4 on USG and magic.5 on V7 or Berkeley; cf Makefile.
56file.c - main program
57file.h - header file
58fsmagic.c - first set of tests the program runs, based on filesystem info
59is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore).
60magdir - directory of /etc/magic pieces
61	magdir/Makefile - ADJUST THIS FOR YOUR CONFIGURATION
62names.h - header file for ascmagic.c
63softmagic.c - 2nd set of tests, based on /etc/magic
64readelf.[ch] - Stand-alone elf parsing code.
65compress.c - on-the-fly decompression.
66print.c - print results, errors, warnings.
67
68If your gzip sometimes fails to decompress things complaining about a short
69file, apply this patch [which is going to be in the next version of gzip]:
70*** -   Tue Oct 29 02:06:35 1996
71--- util.c      Sun Jul 21 21:51:38 1996
72*** 106,111 ****
73--- 108,114 ----
74  
75      if (insize == 0) {
76        if (eof_ok) return EOF;
77+       flush_window();
78        read_error();
79      }
80      bytes_in += (ulg)insize;
81
82E-mail: christos@astron.com
83
84Phone: Do not even think of telephoning me about this program. Send cash first!
85
86Parts of this software were developed at SoftQuad Inc., 56 Aberfoyle
87Cres, # 810, Toronto, Ontario CANADA M8X 2W4.  Phone: 416-239-4801 or
88800-387-2777. Email: mail@sq.com.  Call for information on SGML editing
89and browsing, Unix text processing, and customised products on Unix,
90DOS and Mac.
91
92From: Kees Zeelenberg
93
94An MS-Windows (Win32) port of File-3.40 is available from
95http://gnuwin32.sourceforge.net/
96File is an implementation of the Unix File(1) command.
97It knows the 'magic number' of several thousands of file types.
98