[media-types] Primary file extension and other additional info rmation
Benjamin Drung <[email protected]>
| Newsgroups | gmane.ietf.types |
|---|---|
| Message-ID | <[email protected]> |
Hi everyone, I researched the media type topic and the different projects and use cases. As result I started the media-types project: https://github.com/media-types/media-types It pulls the data from the IANA Media Types Registry and parses it to create an enhanced CSV file. This CSV is used to generate /etc/mime.types. I like this project to just provide what the IANA Media Types Registry declares. I noticed that I like to have more information in the registry: * Human Name: A name that can be presented to the user. Examples: - "Word document" or "Microsoft Word document" for application/msword. - "MPEG-4 video" for vidio/mp4. See "comment" section in https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/data%2Ffreedesktop.org.xml.in for more examples. * Primary file extension(s): Only one media type can claim a primary file extension. Example: - application/xml would declare .xml - application/watcherinfo+xml would declare .wif but not .xml - text/html would declare .html and .htm * Glob pattern: Similar to file extensions, but expressed as glob pattern. - application/xml would declare "*.xml" - text/vnd.debian.copyright would declare "copyright" (the file is named exactly that way) - application/vnd.g3pix.g3fc would declare "*.g3fc" and "*.g3fc[0-9]" * Primary Glob pattern: Similar to primary file extensions, but expressed as glob pattern. Is this mailing list the right place to pitch this idea? What do you think? On Sat, 2026-07-25 at 15:10 +0200, Benjamin Drung wrote: > Hi everyone, > > Linux distributions come with a package providing /etc/mime.types that > contains mimetypes and file name extensions. Many of those use > https://www.iana.org/form/media-types as input for it. To avoid > duplicating work and having small differences in the distributions, I > like to ask IANA to extent the data provided on > https://www.iana.org/form/media-types with two more columns: one for > file name extension and one for magic numbers. > > RFC 6838 §4.12 mentions magic numbers and file name extensions. So this > data is already collected when new mime types are requested. > > What do you think? Are you open for that idea? > > I propose following specification: > > A mime type can have zero to multiple magic numbers and zero to multiple > file name extensions. > > The first file name extensions mentioned is the preferred file name > extensions. > > Similar to mime types, magic numbers and file name extensions must only > be assigned once. In case of conflicts, they should be resolved by a > process that needs to be defined. -- Benjamin Drung Debian & Ubuntu Developer _______________________________________________ media-types mailing list -- [email protected] To unsubscribe send an email to [email protected]