From 750214d6ebee21c56c5eec1cddb64eb989c215aa Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 4 Feb 2008 18:49:43 +0000 Subject: [PATCH] document !mime: entries from rrt@ --- doc/magic.man | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/doc/magic.man b/doc/magic.man index 2f8045d7..7c5b4317 100644 --- a/doc/magic.man +++ b/doc/magic.man @@ -1,4 +1,4 @@ -.\" $File: magic.man,v 1.41 2008/02/04 01:40:53 christos Exp $ +.\" $File: magic.man,v 1.42 2008/02/04 18:49:43 christos Exp $ .Dd January 10, 2007 .Dt MAGIC __FSECTION__ .Os @@ -19,8 +19,8 @@ a test for whether the file begins with a certain .Dq "magic number" . The file .Pa __MAGIC__ -specifies what magic numbers are to be tested for, -what message to print if a particular magic number is found, +specifies what magic numbers are to be tested for, what message or +MIME type to print if a particular magic number is found, and additional information to extract from the file. .Pp Each line of the file specifies a test to be performed. @@ -69,7 +69,7 @@ Finally the .Dq c flag, specifies case insensitive matching: lowercase characters in the magic match both lower and upper case characters in the -targer, whereas upper case characters in the magic, only much uppercase +target, whereas upper case characters in the magic, only much uppercase characters in the target. .It Dv pstring A pascal style string where the first byte is interpreted as the an @@ -277,6 +277,17 @@ remainder of the string with no whitespace added before it: multiple matches are normally separated by a single space. .El .Pp +A MIME type is given on a separate line, which must be the next +non-blank or comment line after the magic line that identifies the +file type, and has the following format: +.Bd -literal -offset indent +!:mime MIMETYPE +.Ed +.Pp +i.e. the literal string +.Dq !:mime +followed by the MIME type. +.Pp Some file formats contain additional information which is to be printed along with the file type or need additional tests to determine the true file type. @@ -464,4 +475,4 @@ a system on which the lengths are invariant. .\" the changes I posted to the S5R2 version. .\" .\" Modified for Ian Darwin's version of the file command. -.\" @(#)$Id: magic.man,v 1.41 2008/02/04 01:40:53 christos Exp $ +.\" @(#)$Id: magic.man,v 1.42 2008/02/04 18:49:43 christos Exp $ -- 2.50.1