Worker uses a file type hierarchy to describe the file types. This means that it is possible to group similar file types together. For example different image formats can be grouped into one "Image" type so the program to display the images only needs to be defined once.
The file type itself can be described in four different ways which are described in the following.
You can also utilize the "file" database from libmagic to detect the file type. In the configuration section you can select a file to see the output of libmagic. The actual pattern can contain the wildcard "*" to match any string.
Available options are:
- enable automatic decompression
- match the MIME description from libmagic
- ignore case when comparing with libmagic output
The file type recognition takes the file type hierarchy into account. Worker starts checking the type of a file at the root of the hierarchy. If the file matches any defined tests of a file type description, Worker checks the child types so the best match in the file type hierarchy is used.
Example: A root file type "executable script" could check if the file starts with "#! /" while any child type checks for additional information like "/bin/sh" for a shell script. This way files without "#!" at the beginning will not be checked for any child type.