mime 0.2.1

Shared MIME-info Database specification implementation


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:


This package provides sub packages which can be used individually:

mime:mimecache - A minimal D application.

mime:mimestore - A minimal D application.

mime:magic - A minimal D application.

mime:mimedatabase - A minimal D application.

Mime

Shared MIME-info database specification implementation in D programming language.

Build Status

Generating documentation

Ddoc:

dub build --build=docs

Ddox:

dub build --build=ddox

Examples

MimeCache

Run to detect mime type of README.md or other files using mime.cache:

dub run mime:mimecache -- README.md lib/libmime.a Makefile CMakeLists.txt test.c test.C test.cpp test.xml

Run to detect mime type of files via magic rules.

dub run mime:mimecache -- --useMagic examples/mimecache/bin/mimecache lib/libmime.a


MimeDatabase

Run to detect mime types of files.

dub run mime:mimedatabase -- README.md source .gitignore lib/libmime.a examples/mimedatabase/bin/mimedatabase /var/run/acpid.socket dub.selections.json

Automated mime path detection works only on Freedesktop platforms. On other systmes or for testing purposes it's possible to use mimepath option to set alternate path to mime/ subfolder. E.g. on Windows using KDE it will be:

dub run mime:mimedatabase -- --mimepath=C:\ProgramData\KDE\share\mime README.md source .gitignore lib/libmime.a examples/mimedatabase/bin/mimedatabase.exe /var/run/acpid.socket dub.selections.json

Features

Implemented features

  • Reading mime.cache files.
  • Using mime.cache files to match file names against glob patterns, match data against magic rules (not fully implemented) and resolve aliases.
  • Reading various files in mime/ subfolder, e.g. globs2, magic and others.

Missing features

  • Reading MIME types from mime/packages sources (requires xml library).
  • Determining MIME type by XMLnamespace if document is xml (requires streaming xml library).
Authors:
  • Roman Chistokhodov
Sub packages:
mime:mimecache, mime:mimestore, mime:magic, mime:mimedatabase
Dependencies:
none
Versions:
0.5.2 2020-Sep-29
0.5.1 2018-Oct-20
0.5.0 2018-Oct-10
0.4.3 2018-May-04
0.4.2 2016-Sep-26
Show all 17 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 349 downloads total

Score:
0.8
Short URL:
mime.dub.pm