Process.this

Constructor.

  1. this(Const!(mstring)[] args)
  2. this(bool copyEnv, Const!(mstring)[] args)
  3. this(cstring command, istring[istring] env)
  4. this(Const!(mstring)[] args, istring[istring] env)
    class Process
    this
    (
    Const!(mstring)[] args
    ,
    istring[istring] env
    )

Parameters

args Const!(mstring)[]

array of strings with the process' arguments; the first argument must be the process' name; the arguments can be empty. Note: The class will use only slices, .dup when necessary.

env istring[istring]

associative array of strings with the process' environment variables; the variable name must be the key of each entry.

Examples

void example ( )
{
     istring[] args;
     istring[istring] env;

     // Process name
     args ~= "myprogram";
     // Process arguments
     args ~= "first argument";
     args ~= "second";
     args ~= "third";

     // Environment variables
     env["MYVAR1"] = "first";
     env["MYVAR2"] = "second";

     auto p = new Process(args, env);
}

Meta