summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2016-10-25 20:33:30 +0000
committerChristos Zoulas <christos@zoulas.com>2016-10-25 20:33:30 +0000
commitade74e7f7e7a3619f5a25b2fd1aa7268c393ca30 (patch)
treeae79a8fbd20a1e707576974b0bfb313b2871824f /doc
parent015b0cdce1a0abb68ab99510e7fc8d2f77e8ec77 (diff)
downloadfile-git-ade74e7f7e7a3619f5a25b2fd1aa7268c393ca30.tar.gz
Sync with file.man describing the location and format of magic files.
Diffstat (limited to 'doc')
-rw-r--r--doc/magic.man18
1 files changed, 12 insertions, 6 deletions
diff --git a/doc/magic.man b/doc/magic.man
index 04015817..837973f3 100644
--- a/doc/magic.man
+++ b/doc/magic.man
@@ -1,4 +1,4 @@
-.\" $File: magic.man,v 1.87 2016/07/20 11:27:08 christos Exp $
+.\" $File: magic.man,v 1.88 2016/07/27 09:42:49 rrt Exp $
.Dd July 20, 2016
.Dt MAGIC __FSECTION__
.Os
@@ -7,7 +7,7 @@
.Nm magic
.Nd file command's magic pattern file
.Sh DESCRIPTION
-This manual page documents the format of the magic file as
+This manual page documents the format of magic files as
used by the
.Xr file __CSECTION__
command, version __VERSION__.
@@ -17,13 +17,19 @@ command identifies the type of a file using,
among other tests,
a test for whether the file contains certain
.Dq "magic patterns" .
-The file
-.Pa __MAGIC__
-specifies what patterns are to be tested for, what message or
+The database of these
+.Dq "magic patterns"
+is usually located in a binary file in
+.Pa __MAGIC__.mgc
+or a directory of source text magic pattern fragment files in
+.Pa __MAGIC__ .
+The database specifies what patterns are to be tested for, what message or
MIME type to print if a particular pattern is found,
and additional information to extract from the file.
.Pp
-Each line of the file specifies a test to be performed.
+The format of the source fragment files that are used to build this database
+is as follows:
+Each line of a fragment file specifies a test to be performed.
A test compares the data starting at a particular offset
in the file with a byte value, a string or a numeric value.
If the test succeeds, a message is printed.