From: Christos Zoulas Date: Tue, 25 Oct 2016 20:33:30 +0000 (+0000) Subject: Sync with file.man describing the location and format of magic files. X-Git-Tag: FILE5_30~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ade74e7f7e7a3619f5a25b2fd1aa7268c393ca30;p=file Sync with file.man describing the location and format of magic files. --- 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.