1999-08-28 01:08:13 +00:00
|
|
|
.\" $FreeBSD$
|
1998-01-28 07:36:25 +00:00
|
|
|
.Dd July 30, 1997
|
|
|
|
.Dt FILE 1 "Copyright but distributable"
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm file
|
|
|
|
.Nd determine file type
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm file
|
|
|
|
.Op Fl vczL
|
|
|
|
.Op Fl f Ar namefile
|
|
|
|
.Op Fl m Ar magicfiles
|
|
|
|
.Ar
|
|
|
|
.Sh DESCRIPTION
|
1997-03-18 19:37:41 +00:00
|
|
|
This manual page documents version 3.22 of the
|
1998-01-28 07:36:25 +00:00
|
|
|
.Nm
|
1997-03-18 19:37:41 +00:00
|
|
|
command.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Nm File
|
1994-09-03 19:16:28 +00:00
|
|
|
tests each argument in an attempt to classify it.
|
|
|
|
There are three sets of tests, performed in this order:
|
|
|
|
filesystem tests, magic number tests, and language tests.
|
|
|
|
The
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em first
|
1994-09-03 19:16:28 +00:00
|
|
|
test that succeeds causes the file type to be printed.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The type printed will usually contain one of the words
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em text
|
1997-03-18 19:37:41 +00:00
|
|
|
(the file contains only
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII
|
1997-03-18 19:37:41 +00:00
|
|
|
characters and is probably safe to read on an
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII
|
1997-03-18 19:37:41 +00:00
|
|
|
terminal),
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em executable
|
1994-09-03 19:16:28 +00:00
|
|
|
(the file contains the result of compiling a program
|
1998-01-28 07:36:25 +00:00
|
|
|
in a form understandable to some
|
|
|
|
.Ux
|
|
|
|
kernel or another),
|
1994-09-03 19:16:28 +00:00
|
|
|
or
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em data
|
1994-09-03 19:16:28 +00:00
|
|
|
meaning anything else (data is usually `binary' or non-printable).
|
|
|
|
Exceptions are well-known file formats (core files, tar archives)
|
|
|
|
that are known to contain binary data.
|
|
|
|
When modifying the file
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa /usr/share/misc/magic
|
1994-09-03 19:16:28 +00:00
|
|
|
or the program itself,
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em "preserve these keywords" .
|
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
People depend on knowing that all the readable files in a directory
|
|
|
|
have the word ``text'' printed.
|
|
|
|
Don't do as Berkeley did \- change ``shell commands text''
|
|
|
|
to ``shell script''.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The filesystem tests are based on examining the return from a
|
1998-01-28 07:36:25 +00:00
|
|
|
.Xr stat 2
|
1994-09-03 19:16:28 +00:00
|
|
|
system call.
|
|
|
|
The program checks to see if the file is empty,
|
|
|
|
or if it's some sort of special file.
|
|
|
|
Any known file types appropriate to the system you are running on
|
|
|
|
(sockets, symbolic links, or named pipes (FIFOs) on those systems that
|
|
|
|
implement them)
|
|
|
|
are intuited if they are defined in
|
|
|
|
the system header file
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa sys/stat.h .
|
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The magic number tests are used to check for files with data in
|
|
|
|
particular fixed formats.
|
|
|
|
The canonical example of this is a binary executable (compiled program)
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa a.out
|
1994-09-03 19:16:28 +00:00
|
|
|
file, whose format is defined in
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa a.out.h
|
1994-09-03 19:16:28 +00:00
|
|
|
and possibly
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa exec.h
|
1994-09-03 19:16:28 +00:00
|
|
|
in the standard include directory.
|
|
|
|
These files have a `magic number' stored in a particular place
|
1998-01-28 07:36:25 +00:00
|
|
|
near the beginning of the file that tells the
|
|
|
|
.Ux
|
|
|
|
operating system
|
1994-09-03 19:16:28 +00:00
|
|
|
that the file is a binary executable, and which of several types thereof.
|
|
|
|
The concept of `magic number' has been applied by extension to data files.
|
|
|
|
Any file with some invariant identifier at a small fixed
|
|
|
|
offset into the file can usually be described in this way.
|
|
|
|
The information in these files is read from the magic file
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa /usr/share/misc/magic .
|
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
If an argument appears to be an
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII
|
1994-09-03 19:16:28 +00:00
|
|
|
file,
|
1998-01-28 07:36:25 +00:00
|
|
|
.Nm
|
1994-09-03 19:16:28 +00:00
|
|
|
attempts to guess its language.
|
1997-03-18 19:37:41 +00:00
|
|
|
The language tests look for particular strings (cf
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa names.h )
|
1994-09-03 19:16:28 +00:00
|
|
|
that can appear anywhere in the first few blocks of a file.
|
|
|
|
For example, the keyword
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em .br
|
1997-03-18 19:37:41 +00:00
|
|
|
indicates that the file is most likely a
|
1998-01-28 07:36:25 +00:00
|
|
|
.Xr troff 1
|
1997-03-18 19:37:41 +00:00
|
|
|
input file, just as the keyword
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em struct
|
1994-09-03 19:16:28 +00:00
|
|
|
indicates a C program.
|
|
|
|
These tests are less reliable than the previous
|
|
|
|
two groups, so they are performed last.
|
|
|
|
The language test routines also test for some miscellany
|
|
|
|
(such as
|
1998-01-28 07:36:25 +00:00
|
|
|
.Xr tar 1
|
1994-09-03 19:16:28 +00:00
|
|
|
archives) and determine whether an unknown file should be
|
1999-09-20 09:15:23 +00:00
|
|
|
labelled as `ASCII text' or `data'.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl v
|
1996-01-23 12:40:36 +00:00
|
|
|
Print the version of the program and exit.
|
1998-01-28 07:36:25 +00:00
|
|
|
.It Fl m Ar list
|
|
|
|
Specify an alternate
|
|
|
|
.Ar list
|
|
|
|
of files containing magic numbers.
|
1996-01-23 12:40:36 +00:00
|
|
|
This can be a single file, or a colon-separated list of files.
|
1998-01-28 07:36:25 +00:00
|
|
|
.It Fl z
|
1996-01-23 12:40:36 +00:00
|
|
|
Try to look inside compressed files.
|
1998-01-28 07:36:25 +00:00
|
|
|
.It Fl c
|
1996-01-23 12:40:36 +00:00
|
|
|
Cause a checking printout of the parsed form of the magic file.
|
1994-09-03 19:16:28 +00:00
|
|
|
This is usually used in conjunction with
|
1998-01-28 07:36:25 +00:00
|
|
|
.Fl m
|
1994-09-03 19:16:28 +00:00
|
|
|
to debug a new magic file before installing it.
|
1998-01-28 07:36:25 +00:00
|
|
|
.It Fl f Ar namefile
|
1996-01-23 12:40:36 +00:00
|
|
|
Read the names of the files to be examined from
|
1998-01-28 07:36:25 +00:00
|
|
|
.Ar namefile
|
1996-01-23 12:40:36 +00:00
|
|
|
(one per line)
|
1994-09-03 19:16:28 +00:00
|
|
|
before the argument list.
|
|
|
|
Either
|
1998-01-28 07:36:25 +00:00
|
|
|
.Ar namefile
|
1994-09-03 19:16:28 +00:00
|
|
|
or at least one filename argument must be present;
|
|
|
|
to test the standard input, use ``-'' as a filename argument.
|
1998-01-28 07:36:25 +00:00
|
|
|
.It Fl L
|
|
|
|
Cause symlinks to be followed, as the like-named option in
|
|
|
|
.Xr ls 1 .
|
1996-01-23 12:40:36 +00:00
|
|
|
(on systems that support symbolic links).
|
1998-01-28 07:36:25 +00:00
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /usr/share/misc/magic -compact
|
|
|
|
.It Pa /usr/share/misc/magic
|
|
|
|
default list of magic numbers (used to be
|
|
|
|
.Pa /etc/magic
|
|
|
|
in previous versions of
|
|
|
|
.Bx Free )
|
|
|
|
.El
|
|
|
|
.Sh ENVIRONMENT
|
1996-01-23 12:40:36 +00:00
|
|
|
The environment variable
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em MAGIC
|
1996-01-23 12:40:36 +00:00
|
|
|
can be used to set the default magic number files.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr od 1 ,
|
|
|
|
.Xr strings 1 ,
|
|
|
|
.Xr magic 5
|
|
|
|
.Sh STANDARDS CONFORMANCE
|
1994-09-03 19:16:28 +00:00
|
|
|
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.
|
1998-01-28 07:36:25 +00:00
|
|
|
Its behaviour is mostly compatible with the System V program of the same name.
|
1994-09-03 19:16:28 +00:00
|
|
|
This version knows more magic, however, so it will produce
|
|
|
|
different (albeit more accurate) output in many cases.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The one significant difference
|
|
|
|
between this version and System V
|
|
|
|
is that this version treats any white space
|
|
|
|
as a delimiter, so that spaces in pattern strings must be escaped.
|
|
|
|
For example,
|
|
|
|
.br
|
|
|
|
>10 string language impress\ (imPRESS data)
|
|
|
|
.br
|
|
|
|
in an existing magic file would have to be changed to
|
|
|
|
.br
|
|
|
|
>10 string language\e impress (imPRESS data)
|
|
|
|
.br
|
|
|
|
In addition, in this version, if a pattern string contains a backslash,
|
|
|
|
it must be escaped. For example
|
|
|
|
.br
|
|
|
|
0 string \ebegindata Andrew Toolkit document
|
|
|
|
.br
|
|
|
|
in an existing magic file would have to be changed to
|
|
|
|
.br
|
|
|
|
0 string \e\ebegindata Andrew Toolkit document
|
|
|
|
.br
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
SunOS releases 3.2 and later from Sun Microsystems include a
|
1998-01-28 07:36:25 +00:00
|
|
|
.Xr file 1
|
1994-09-03 19:16:28 +00:00
|
|
|
command derived from the System V one, but with some extensions.
|
|
|
|
My version differs from Sun's only in minor ways.
|
|
|
|
It includes the extension of the `&' operator, used as,
|
|
|
|
for example,
|
|
|
|
.br
|
|
|
|
>16 long&0x7fffffff >0 not stripped
|
1998-01-28 07:36:25 +00:00
|
|
|
.Sh MAGIC DIRECTORY
|
1994-09-03 19:16:28 +00:00
|
|
|
The magic file entries have been collected from various sources,
|
|
|
|
mainly USENET, and contributed by various authors.
|
1998-01-28 07:36:25 +00:00
|
|
|
.An Christos Zoulas
|
|
|
|
(address below) will collect additional
|
1994-09-03 19:16:28 +00:00
|
|
|
or corrected magic file entries.
|
|
|
|
A consolidation of magic file entries
|
|
|
|
will be distributed periodically.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The order of entries in the magic file is significant.
|
|
|
|
Depending on what system you are using, the order that
|
|
|
|
they are put together may be incorrect.
|
|
|
|
If your old
|
1998-01-28 07:36:25 +00:00
|
|
|
.Nm
|
1994-09-03 19:16:28 +00:00
|
|
|
command uses a magic file,
|
|
|
|
keep the old magic file around for comparison purposes
|
|
|
|
(rename it to
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa /usr/share/misc/magic.orig Ns ).
|
|
|
|
.Sh HISTORY
|
1994-09-03 19:16:28 +00:00
|
|
|
There has been a
|
1998-01-28 07:36:25 +00:00
|
|
|
.Nm
|
|
|
|
command in every
|
|
|
|
.Ux
|
|
|
|
since at least Research Version 6
|
1994-09-03 19:16:28 +00:00
|
|
|
(man page dated January, 1975).
|
|
|
|
The System V version introduced one significant major change:
|
|
|
|
the external list of magic number types.
|
|
|
|
This slowed the program down slightly but made it a lot more flexible.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
This program, based on the System V version,
|
1998-01-28 07:36:25 +00:00
|
|
|
was written by
|
|
|
|
.An Ian Darwin
|
|
|
|
without looking at anybody else's source code.
|
|
|
|
.Pp
|
|
|
|
.An John Gilmore
|
|
|
|
revised the code extensively, making it better than
|
1994-09-03 19:16:28 +00:00
|
|
|
the first version.
|
1998-01-28 07:36:25 +00:00
|
|
|
.An Geoff Collyer
|
|
|
|
found several inadequacies
|
1994-09-03 19:16:28 +00:00
|
|
|
and provided some magic file entries.
|
|
|
|
The program has undergone continued evolution since.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Sh AUTHORS
|
|
|
|
Written by
|
1998-03-23 07:48:45 +00:00
|
|
|
.An Ian F. Darwin Aq ian@sq.com ,
|
1998-01-28 07:36:25 +00:00
|
|
|
UUCP address {utzoo | ihnp4}!darwin!ian,
|
1994-09-03 19:16:28 +00:00
|
|
|
postal address: P.O. Box 603, Station F, Toronto, Ontario, CANADA M4Y 2L8.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
|
|
|
Altered by
|
|
|
|
.An Rob McMahon Aq cudcv@warwick.ac.uk ,
|
|
|
|
1989, to extend the `&' operator
|
1994-09-03 19:16:28 +00:00
|
|
|
from simple `x&y != 0' to `x&y op z'.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
|
|
|
Altered by
|
|
|
|
.An Guy Harris Aq guy@auspex.com ,
|
|
|
|
1993, to:
|
|
|
|
.Bl -item -offset indent
|
|
|
|
.It
|
1994-09-03 19:16:28 +00:00
|
|
|
put the ``old-style'' `&'
|
1998-01-28 07:36:25 +00:00
|
|
|
operator back the way it was, because
|
|
|
|
.Bl -enum -offset indent
|
|
|
|
.It
|
|
|
|
Rob McMahon's change broke the
|
|
|
|
previous style of usage,
|
|
|
|
.It
|
|
|
|
The SunOS ``new-style'' `&' operator, which this version of
|
|
|
|
.Nm
|
|
|
|
supports, also handles `x&y op z',
|
|
|
|
.It
|
|
|
|
Rob's change wasn't documented in any case;
|
|
|
|
.El
|
|
|
|
.It
|
1994-09-03 19:16:28 +00:00
|
|
|
put in multiple levels of `>';
|
1998-01-28 07:36:25 +00:00
|
|
|
.It
|
1994-09-03 19:16:28 +00:00
|
|
|
put in ``beshort'', ``leshort'', etc. keywords to look at numbers in the
|
|
|
|
file in a specific byte order, rather than in the native byte order of
|
|
|
|
the process running
|
1998-01-28 07:36:25 +00:00
|
|
|
.Nm file .
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
Changes by
|
|
|
|
.An Ian Darwin
|
|
|
|
and various authors including
|
|
|
|
.An Christos Zoulas Aq christos@deshaw.com ,
|
|
|
|
1990-1992.
|
|
|
|
.Sh LEGAL NOTICE
|
1994-09-03 19:16:28 +00:00
|
|
|
Copyright (c) Ian F. Darwin, Toronto, Canada,
|
|
|
|
1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
This software is not subject to and may not be made subject to any
|
|
|
|
license of the American Telephone and Telegraph Company, Sun
|
|
|
|
Microsystems Inc., Digital Equipment Inc., Lotus Development Inc., the
|
|
|
|
Regents of the University of California, The X Consortium or MIT, or
|
|
|
|
The Free Software Foundation.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
This software is not subject to any export provision of the United States
|
|
|
|
Department of Commerce, and may be exported to any country or planet.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
Permission is granted to anyone to use this software for any purpose on
|
|
|
|
any computer system, and to alter it and redistribute it freely, subject
|
|
|
|
to the following restrictions:
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -enum -offset indent
|
|
|
|
.It
|
|
|
|
The author is not responsible for the consequences of use of this
|
|
|
|
software, no matter how awful, even if they arise from flaws in it;
|
|
|
|
.It
|
|
|
|
The origin of this software must not be misrepresented, either by
|
1994-09-03 19:16:28 +00:00
|
|
|
explicit claim or by omission. Since few users ever read sources,
|
1998-01-28 07:36:25 +00:00
|
|
|
credits must appear in the documentation;
|
|
|
|
.It
|
|
|
|
Altered versions must be plainly marked as such, and must not be
|
1994-09-03 19:16:28 +00:00
|
|
|
misrepresented as being the original software. Since few users
|
1998-01-28 07:36:25 +00:00
|
|
|
ever read sources, credits must appear in the documentation;
|
|
|
|
.It
|
|
|
|
This notice may not be removed or altered.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
A few support files (
|
|
|
|
.Fn getopt ,
|
|
|
|
.Fn strtok )
|
1994-09-03 19:16:28 +00:00
|
|
|
distributed with this package
|
1998-01-28 07:36:25 +00:00
|
|
|
are by
|
|
|
|
.An Henry Spencer
|
|
|
|
and are subject to the same terms as above.
|
|
|
|
.Pp
|
|
|
|
A few simple support files (
|
|
|
|
.Fn strtol ,
|
|
|
|
.Fn strchr )
|
1994-09-03 19:16:28 +00:00
|
|
|
distributed with this package
|
|
|
|
are in the public domain; they are so marked.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The files
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa tar.h
|
1994-09-03 19:16:28 +00:00
|
|
|
and
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa is_tar.c
|
|
|
|
were written by
|
|
|
|
.An John Gilmore
|
|
|
|
from his public-domain
|
|
|
|
.Nm tar
|
1994-09-03 19:16:28 +00:00
|
|
|
program, and are not covered by the above restrictions.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Sh BUGS
|
1994-09-03 19:16:28 +00:00
|
|
|
There must be a better way to automate the construction of the Magic
|
|
|
|
file from all the glop in Magdir. What is it?
|
|
|
|
Better yet, the magic file should be compiled into binary (say,
|
1998-01-28 07:36:25 +00:00
|
|
|
.Xr ndbm 3
|
1997-03-18 19:37:41 +00:00
|
|
|
or, better yet, fixed-length
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII
|
1997-03-18 19:37:41 +00:00
|
|
|
strings for use in heterogenous network environments) for faster startup.
|
1994-09-03 19:16:28 +00:00
|
|
|
Then the program would run as fast as the Version 7 program of the same name,
|
|
|
|
with the flexibility of the System V version.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
|
|
|
.Nm File
|
1994-09-03 19:16:28 +00:00
|
|
|
uses several algorithms that favor speed over accuracy,
|
1997-03-18 19:37:41 +00:00
|
|
|
thus it can be misled about the contents of
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII
|
1997-03-18 19:37:41 +00:00
|
|
|
files.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1997-03-18 19:37:41 +00:00
|
|
|
The support for
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII
|
1997-03-18 19:37:41 +00:00
|
|
|
files (primarily for programming languages)
|
1994-09-03 19:16:28 +00:00
|
|
|
is simplistic, inefficient and requires recompilation to update.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
There should be an ``else'' clause to follow a series of continuation lines.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The magic file and keywords should have regular expression support.
|
1997-03-18 19:37:41 +00:00
|
|
|
Their use of
|
1998-01-28 07:36:25 +00:00
|
|
|
.Tn ASCII TAB
|
1997-03-18 19:37:41 +00:00
|
|
|
as a field delimiter is ugly and makes
|
1994-09-03 19:16:28 +00:00
|
|
|
it hard to edit the files, but is entrenched.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
It might be advisable to allow upper-case letters in keywords
|
1997-03-18 19:37:41 +00:00
|
|
|
for e.g.,
|
1998-01-28 07:36:25 +00:00
|
|
|
.Xr troff 1
|
1997-03-18 19:37:41 +00:00
|
|
|
commands vs man page macros.
|
1994-09-03 19:16:28 +00:00
|
|
|
Regular expression support would make this easy.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The program doesn't grok \s-2FORTRAN\s0.
|
|
|
|
It should be able to figure \s-2FORTRAN\s0 by seeing some keywords which
|
|
|
|
appear indented at the start of line.
|
|
|
|
Regular expression support would make this easy.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The list of keywords in
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em ascmagic
|
1994-09-03 19:16:28 +00:00
|
|
|
probably belongs in the Magic file.
|
|
|
|
This could be done by using some keyword like `*' for the offset value.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1996-01-30 13:52:50 +00:00
|
|
|
Another optimization would be to sort
|
1994-09-03 19:16:28 +00:00
|
|
|
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. Complain about conflicts in the magic file entries.
|
|
|
|
Make a rule that the magic entries sort based on file offset rather
|
|
|
|
than position within the magic file?
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
The program should provide a way to give an estimate
|
|
|
|
of ``how good'' a guess is.
|
|
|
|
We end up removing guesses (e.g. ``From '' as first 5 chars of file) because
|
|
|
|
they are not as good as other guesses (e.g. ``Newsgroups:'' versus
|
|
|
|
"Return-Path:"). Still, if the others don't pan out, it should be
|
|
|
|
possible to use the first guess.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pp
|
|
|
|
This program is slower than some vendors'
|
|
|
|
.Nm
|
|
|
|
commands.
|
|
|
|
.Pp
|
1994-09-03 19:16:28 +00:00
|
|
|
This manual page, and particularly this section, is too long.
|
1998-01-28 07:36:25 +00:00
|
|
|
.Sh AVAILABILITY
|
1994-09-03 19:16:28 +00:00
|
|
|
You can obtain the original author's latest version by anonymous FTP
|
|
|
|
on
|
1998-01-28 07:36:25 +00:00
|
|
|
.Em ftp.deshaw.com
|
1994-09-03 19:16:28 +00:00
|
|
|
in the directory
|
1998-01-28 07:36:25 +00:00
|
|
|
.Pa /pub/file/file-X.YY.tar.gz
|