.TH FILE __CSECTION__ "Copyright but distributable"
-.\" $Id: file.man,v 1.57 2005/08/18 15:18:22 christos Exp $
+.\" $Id: file.man,v 1.58 2006/05/03 19:20:25 christos Exp $
.SH NAME
file
\- determine file type
rather
than ``ASCII text''.
In order for this option to work, file changes the way
-it handles files recognised by the command itself (such as many of the
+it handles files recognized by the command itself (such as many of the
text file types, directories etc), and makes use of an alternative
``magic'' file.
(See ``FILES'' section, below).
This program is believed to exceed the System V Interface Definition
of FILE(CMD), as near as one can determine from the vague language
contained therein.
-Its behaviour is mostly compatible with the System V program of the same name.
+Its behavior is mostly compatible with the System V program of the same name.
This version knows more magic, however, so it will produce
different (albeit more accurate) output in many cases.
+.\" URL: http://www.opengroup.org/onlinepubs/009695399/utilities/file.html
.PP
The one significant difference
between this version and System V
program, and are not covered by the above license.
.SH BUGS
There must be a better way to automate the construction of the Magic
-file from all the glop in magdir.
+file from all the glop in Magdir.
What is it?
Better yet, the magic file should be compiled into binary (say,
.BR ndbm (3)
probably belongs in the Magic file.
This could be done by using some keyword like `*' for the offset value.
.PP
-Another optimisation would be to sort
+Another optimization would be to sort
the magic file so that we can just run down all the
tests for the first byte, first word, first long, etc, once we
have fetched it.
.PP
Sometimes you do not know the exact offset as this depends on the length or
position (when indirection was used before) of preceding fields. You can
-specify an offset relative to the end of the last uplevel field using
+specify an offset relative to the end of the last up-level field using
.BI &
as a prefix to the offset:
.sp
>0x18 leshort >0x3f
>>(0x3c.l) string LE\e0\e0 LE executable (MS-Windows)
# at offset 0x80 (-4, since relative offsets start at the end
- # of the uplevel match) inside the LE header, we find the absolute
+ # of the up-level match) inside the LE header, we find the absolute
# offset to the code area, where we look for a specific signature
>>>(&0x7c.l+0x26) string UPX \eb, UPX compressed
.fi
.fi
.PP
Finally, if you have to deal with offset/length pairs in your file, even the
-second value in a parenthesed expression can be taken from the file itself,
+second value in a parenthesized expression can be taken from the file itself,
using another set of parentheses. Note that this additional indirect offset
is always relative to the start of the main indirect offset.
.sp
.\" the changes I posted to the S5R2 version.
.\"
.\" Modified for Ian Darwin's version of the file command.
-.\" @(#)$Id: magic.man,v 1.30 2006/02/19 18:16:03 christos Exp $
+.\" @(#)$Id: magic.man,v 1.31 2006/05/03 19:20:25 christos Exp $