mimePaths

Get shared MIME database paths in system.

This function is Freedesktop only. Note: This function does not check if paths exist and appear to be directories.

  1. auto mimePaths(Range dataPaths)
  2. auto mimePaths()
    @safe
    static if(isFreedesktop)
    mimePaths
    ()

Return Value

Type: auto

Range of MIME paths in the order of preference from the most preferable to the least. Usually it's the same as $HOME/.local/share/mime, /usr/local/share/mime and /usr/share/mime.

Examples

auto dataHomeGuard = EnvGuard("XDG_DATA_HOME");
auto dataDirsGuard = EnvGuard("XDG_DATA_DIRS");

environment["XDG_DATA_HOME"] = "/home/user/data";
environment["XDG_DATA_DIRS"] = "/usr/local/data:/usr/data";

assert(mimePaths() == [
    "/home/user/data/mime", "/usr/local/data/mime", "/usr/data/mime"
]);

Meta