On Saturday, 16 April 2016 at 18:48:36 UTC, FreeSlave wrote:
mimeapps is a library for detection of which applications can be used to open files of given MIME type.

Note: this is essential only for systems that follow Freedesktop specifications, i.e. Linux, BSD and some others. MS Windows and OS X have their own file type associations systems.

github repo: https://github.com/MyLittleRobo/mimeapps (examples included)
dub package: http://code.dlang.org/packages/mimeapps
Specification: https://www.freedesktop.org/wiki/Specifications/mime-apps-spec/

Use cases:

1. Building "Open with" menu.
2. Finding user preferred application for specific file type, e.g. text editor for text/plain or file manager for inode/directory. 3. Finding user preferred application to open uri, e.g. user preferred web browser for http and https links.

Related libraries:

https://github.com/MyLittleRobo/desktopfile - reading and executing .desktop files. https://github.com/MyLittleRobo/mime - parsing shared MIME type database and detecting MIME types of files.

Wow. I just wanted to port libmagic since need it. Can you write a short introduction how I can work with the magic database (defining mime type of a file based on its content)?

Reply via email to