spawnProcessDetached

Undocumented in source. Be warned that the author may not have intended to support it.
  1. void spawnProcessDetached(char[][] args, File stdin, File stdout, File stderr, string[string] env, Config config, char[] workingDirectory, ulong* pid)
  2. void spawnProcessDetached(char[][] args, File stdin, File stdout, File stderr, string[string] env, Config config, char[] workingDirectory, ulong* pid)
  3. void spawnProcessDetached(char[][] args, File stdin, File stdout, File stderr, string[string] env, Config config, char[] workingDirectory, ulong* pid)
    static if(!(!is(typeof( ))))
    void
    spawnProcessDetached
    (
    in char[][] args
    ,
    File stdin = std.stdio.stdin
    ,
    File stdout = std.stdio.stdout
    ,
    File stderr = std.stdio.stderr
    ,
    const string[string] env = null
    ,
    Config config = Config.none
    ,
    in char[] workingDirectory = null
    ,
    ulong* pid = null
    )
  4. void spawnProcessDetached(char[][] args, string[string] env, Config config, char[] workingDirectory, ulong* pid)

Examples

import std.exception : assertThrown;
version(Posix) {
    try {
        auto devNull = File("/dev/null", "rwb");
        ulong pid;
        spawnProcessDetached(["whoami"], devNull, devNull, devNull, null, Config.none, "./test", &pid);
        assert(pid != 0);

        assertThrown(spawnProcessDetached(["./test/nonexistent"]));
        assertThrown(spawnProcessDetached(["./test/executable.sh"], devNull, devNull, devNull, null, Config.none, "./test/nonexistent"));
        assertThrown(spawnProcessDetached(["./dub.json"]));
        assertThrown(spawnProcessDetached(["./test/notreallyexecutable"]));
    } catch(Exception e) {

    }
}
version(Windows) {
    try {
        ulong pid;
        spawnProcessDetached(["whoami"], std.stdio.stdin, std.stdio.stdout, std.stdio.stderr, null, Config.none, "./test", &pid);

        assertThrown(spawnProcessDetached(["dub.json"]));
    } catch(Exception e) {

    }
}

Meta