[BACK]Return to README CVS log [TXT][DIR] Up to [local] / src / usr.bin / file

Annotation of src/usr.bin/file/README, Revision 1.5

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