spawnProcessDetached

Spawns a new process, optionally assigning it an arbitrary set of standard input, output, and error streams.

The function returns immediately, leaving the spawned process to execute in parallel with its parent.

The spawned process is detached from its parent, so you should not wait on the returned pid.

  1. 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)
    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
    )
  2. void spawnProcessDetached(in char[][] args, const string[string] env, Config config = Config.none, in char[] workingDirectory = null, ulong* pid = null)

Parameters

args
Type: char[][]

An array which contains the program name as the zeroth element and any command-line arguments in the following elements.

stdin
Type: File

The standard input stream of the spawned process.

stdout
Type: File

The standard output stream of the spawned process.

stderr
Type: File

The standard error stream of the spawned process.

env
Type: string[string]

Additional environment variables for the child process.

config
Type: Config

Flags that control process creation. Same as for spawnProcess.

workingDirectory
Type: char[]

The working directory for the new process.

pid
Type: ulong*

Pointer to variable that will get pid value in case spawnProcessDetached succeed. Not used if null.

See Also

Meta