# mime.types

## NAME



           mime.types - mime type description file for cups
    


## DESCRIPTION



           The **mime.types** file defines the recognized file types.
    
           Additional file types are specified in files with the extension
           _.types_ in the CUPS configuration directory.
    
           Each line in the **mime.types** file is a comment, blank, or rule
           line.  Comment lines start with the # character.  Rule lines start
           with the MIME media type and are optionally followed by a series
           of file recognition rules:
    
               _mime/type_ [ _rule_ ... _rule_ ]
    
           Rules can be extended over multiple lines using the backslash
           character (\):
    
               _mime/type_ [ _really-really-really-long-rule_ ... **\**
                 _rule_ ]
    
           MIME media types specified by the _mime/type_ field are case-
           insensitive and are sorted in ascending alphanumeric order for the
           purposes of matching.  See the "TYPE MATCHING AND PRIORITY"
           section for more information.
    
           The rules may be grouped using parenthesis, joined using "+" for a
           logical AND, joined using "," or whitespace for a logical OR, and
           negated using "!".
    
       **RULES**
           Rules take two forms - a filename extension by itself and
           functions with test values inside parenthesis.  The following
           functions are available:
    
           **match("**_PATTERN_**")**
                True if the filename matches the given shell wildcard
                _PATTERN_.
    
           **ascii(**_OFFSET_**,**_LENGTH_**)**
                True if the _LENGTH_ bytes starting at _OFFSET_ are valid
                printable ASCII (CR, NL, TAB, BS, 32-126).  _LENGTH_ cannot
                exceed 8192 bytes.
    
           **printable(**_OFFSET_**,**_LENGTH_**)**
                True if the _LENGTH_ bytes starting at _OFFSET_ are printable
                8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).  _LENGTH_
                cannot exceed 8192 bytes.
    
           **priority(**_NUMBER_**)**
                Specifies the relative priority of this MIME media type.  The
                default priority is 100.  Larger values have higher priority
                while smaller values have lower priority.
    
           **string(**_OFFSET_**,"**_STRING_**")**
                True if the bytes starting at _OFFSET_ are identical to _STRING_.
    
           **istring(**_OFFSET_**,"**_STRING_**")**
                True if the bytes starting at _OFFSET_ match _STRING_ without
                respect to case.
    
           **char(**_OFFSET_**,**_VALUE_**)**
                True if the byte at _OFFSET_ is identical to _VALUE_.
    
           **short(**_OFFSET_**,**_VALUE_**)**
                True if the 16-bit big-endian integer at _OFFSET_ is identical
                to _VALUE_.
    
           **int(**_OFFSET_**,**_VALUE_**)**
                True if the 32-bit big-endian integer at _OFFSET_ is identical
                to _VALUE_.
    
           **locale("**_STRING_**")**
                True if current locale matches _STRING_.
    
           **contains(**_OFFSET_**,**_LENGTH_**,"**_STRING_**")**
                True if the bytes starting at _OFFSET_ for _LENGTH_ bytes
                contains _STRING_.  _LENGTH_ cannot exceed 8192 bytes.
    
       **STRING CONSTANTS**
           String constants can be specified inside quotes ("") for strings
           containing whitespace and angle brackets (<>) for hexadecimal
           strings.
    
       **TYPE MATCHING AND PRIORITY**
           When CUPS needs to determine the MIME media type of a given file,
           it checks every MIME media type defined in the _.types_ files.  When
           two or more types match a given file, the type chosen will depend
           on the type name and priority, with higher-priority types being
           used over lower-priority ones.  If the types have the same
           priority, the type names are sorted alphanumerically in ascending
           order and the first type is chosen.
    
           For example, if two types "text/bar" and "text/foo" are defined as
           matching the extension "doc", normally the type "text/bar" will be
           chosen since its name is alphanumerically smaller than "text/foo".
           However, if "text/foo" also defines a higher priority than
           "text/bar", "text/foo" will be chosen instead.
    


## FILES



           _/etc/cups_ - Typical CUPS configuration directory.
    


## EXAMPLES



           Define two MIME media types for raster data, with one being a
           subset with higher priority:
    
               application/vnd.cups-raster  string(0,"RaSt") string(0,"tSaR") \
                                             string(0,"RaS2") string(0,"2SaR") \
                                             string(0,"RaS3") string(0,"3SaR")
    
               image/pwg-raster              string(0,"RaS2") + \
                                             string(4,PwgRaster<00>) priority(150)
    


* * *