Skip to main content

Module types

Module types 

Source
Expand description

What the database knows about a type, as opposed to about a file: its other names, what it is a kind of, and what to call it in front of a person.

Three more plain files next to globs2:

  • aliases — alias canonical, one per line. application/acrobat is application/pdf under an older name, and a lookup that does not resolve it will miss a perfectly good association.
  • subclasses — child parent. A .3mf is a zip and a application/yaml is text; an application registered for the parent can open the child.
  • <media>/<subtype>.xml — the type’s <comment>, translated. “STL 3D model” rather than model/stl.

§The two subclass rules that are not in the file

The specification states them in prose and every implementation has to add them by hand: every text/* is a subclass of text/plain, and everything whatsoever is a subclass of application/octet-stream. Leave them out and “can this application open this file” answers no for every text editor and every file.

Structs§

Types
The type graph: aliases, subclasses and descriptions.

Functions§

description_of
One type’s description, read and not remembered.
inode_type
Whether path is something other than an ordinary file, and what the database calls that.
mime_dirs
Every mime directory to read, for a caller that has its own list of XDG data directories.