-** ALPHA TEST RELEASE **
-You are getting this ahead of the rest of the world because
-you need it or because I like you or something. Please do not
-forward it to anybody yet. The "official" version will appear
-in mod.sources at a theater or USENET site near you in time
-for the Christmas rush.
-
** File(1) Command **
-This is Ian Darwin's (copyright but distributable unmodified)
-file(1) command. It follows the USG (Sys V) model of the file
-command, rather than the Research (V7) version. That is, there
-is a file (/etc/magic) that contains much of the ritual information
-that is the source of this program's power. It knows a little
-more magic (including tar archives) than System V; the /etc/magic
-parsing seems to be compatible with the (poorly documented)
-System V /etc/magic format.
+
+This is Ian Darwin's (copyright but distributable) file(1)
+command. It follows the USG (Sys V) model of the file command,
+rather than the Research (V7) version or the V7-derived Berkeley
+one. That is, there is a file (/etc/magic) that contains much
+of the ritual information that is the source of this program's
+power. It knows a little more magic (including tar archives)
+than System V; the /etc/magic parsing seems to be compatible
+with the (poorly documented) System V /etc/magic format (with
+one exception; see the man page).
In addition, the /etc/magic file is built from a subdirectory
-for easier maintenance. At the instigation of John Gilmore,
-I will act as a clearinghouse for magic numbers assigned to
-all sorts of whacko data files that are in reasonable circulation.
-Send your whacko magic numbers, in file(5) format please(!), to the
-address above.
+for easier maintenance. I will act as a clearinghouse for
+magic numbers assigned to all sorts of whacko data files that
+are in reasonable circulation. Send your whacko magic numbers,
+in file(5) format please(!), to the author, Ian Darwin,
+{utzoo|ihnp4}!darwin!ian, ian@sq.com.
LEGAL.NOTICE - read this first.
-README - read this second.
-Makefile - read this third.
-TODO - read this last (sigh).
+README - read this second (you are currently reading this file).
+PORTING - read this next.
+Makefile - read this next, fix it if needed, type "make".
apprentice.c - parses /etc/magic to learn magic
ascmagic.c - third & last set of tests, based on hardwired assumptions.
-core - not included in distribution
+core - not included in distribution due to mailer limitations.
debug.c - includes -c printout routine
file.1 - man page
+magic.4 - another man page, courtesy Guy Harris.
file.c - main program
file.h - fairly standard header file
fsmagic.c - first set of tests the program runs, based on filesystem info
-is_tar.c - knows about tarchives (courtesy of Fred Blonder, U Maryland)
+is_tar.c - knows about tarchives (courtesy of John Gilmore).
magdir - directory of /etc/magic pieces
names.h - header file for ascmagic.c
softmagic.c - 2nd set of tests, based on /etc/magic
+strtok.c - in case you need it (from Henry Spencer).
strtol.c - in case you need it
-strtol.tst.c - in case you need to test it
-
-Portability of the new file(1) command.
+Portability of the new file(1) command:
Obviously if you are running the old Ritchie compiler or
something else that doesn't know about void, you will have
didn't have any system-dependant #ifdefs, no special libraries,
etc., etc. Well, System V shot me down. They moved the definition
of major() and minor() out of <sys/types.h> into <sys/sysmacros.h>.
-So, if major isn't defined after including types.h, I automatically
-include sys/sysmacros.h. If you have a system in which neither
-types.h nor sysmacros.h defines `major', you will get a compilation
+So, if major isn't defined after including types.h, I AUTOMATICALLY
+include sys/sysmacros.h. ONLY if you have a system in which neither
+types.h nor sysmacros.h defines `major' will this automatic include
+fail. On such systems, you will get a compilation
error in trying to compile a warning message. Please do the following:
1) change the appropriate (2nd) #include at the start of
fsmagic.c
Other than this, there should be no portability problems,
but one never knows these days. Please let me know of any
other problems you find porting to a UNIX system. I don't much
-care about non-UNIX systems but will collect magic numbers
-for them.
+care for non-UNIX systems but will collect widely-used magic
+numbers for them as well as for UNIX systems.
Ian Darwin
Toronto, Canada