Process.execute

Execute a process using the command line arguments as parameters to this method.

Once the process is executed successfully, its input and output can be manipulated through the stdin, stdout and stderr member PipeConduit's.

This also clears the copyEnv flag

More...
  1. void execute(const(char)[] arg1, const(char[])[] args)
  2. void execute(const(char)[] command, const(char[])[const(char)[]] env)
  3. void execute(const(char[])[] args, const(char[])[char[]] env)
    class Process
    deprecated
    void
    execute
    (
    const(char[])[] args
    ,
    const(char[])[char[]] env
    )
  4. Process execute()

Parameters

args const(char[])[]

array of strings with the process' arguments; the first argument must be the process' name; the arguments can be empty.

env const(char[])[char[]]

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

Detailed Description

Deprecated: Use properties or the constructor to set these parameters instead.

Throws

ProcessCreateException if the process could not be created successfully; ProcessForkException if the call to the fork() system call failed (on POSIX-compatible platforms).

Remarks: The process must not be running and the provided list of arguments must not be empty. If there was any argument already present in the args member, they will be replaced by the arguments supplied to the method.

Examples

auto p = new Process();
char[][] args;

args ~= "ls";
args ~= "-l";

p.execute(args, null);

Meta