From 916b4bbacb652876752f527e84c63a0e9625dd32 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Tue, 25 Oct 2016 20:33:30 +0000 Subject: [PATCH] Sync with file.man describing the location and format of magic files. --- doc/magic.man | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/magic.man b/doc/magic.man index bc374040..e36ea544 100644 --- a/doc/magic.man +++ b/doc/magic.man @@ -1,4 +1,4 @@ -.\" $File: magic.man,v 1.88 2016/07/27 09:42:49 rrt Exp $ +.\" $File: magic.man,v 1.89 2016/10/25 20:33:30 christos 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. -- 2.40.0