xdgRuntimeDir

Undocumented in source. Be warned that the author may not have intended to support it.
  1. string xdgRuntimeDir()
  2. string xdgRuntimeDir()
    @trusted nothrow
    static if(isFreedesktop)
    string
    xdgRuntimeDir
    ()

Examples

string runtimePath = buildPath(tempDir(), "xdgpaths-runtime-test");
try {
    collectException(std.file.rmdir(runtimePath));

    if (mkdir(runtimePath.toStringz, privateMode) == 0) {
        auto runtimeGuard = EnvGuard("XDG_RUNTIME_DIR");
        environment["XDG_RUNTIME_DIR"] = runtimePath;
        assert(xdgRuntimeDir() == runtimePath);

        if (chmod(runtimePath.toStringz, octal!777) == 0) {
            assert(xdgRuntimeDir() == string.init);
        }

        std.file.rmdir(runtimePath);
    } else {
        version(XdgPathsRuntimeDebug) stderr.writeln(fromStringz(strerror(errno)));
    }
} catch(Exception e) {
    version(XdgPathsRuntimeDebug) stderr.writeln(e.msg);
}

Meta