process

Note: parts of this file are platform-conditional (#if).

ProcessResult: status, output

Functions: getenv, setenv, run

struct ProcessResult

The exit code and standard output of a finished subprocess.

status

int status;

output

StringBuf output;

getenv

string? getenv(string name)

Returns the value of the environment variable, or null if it's not set.

setenv

void setenv(string name, string value)

Sets the environment variable, aborting on failure.

run

ProcessResult run(string command)

Runs the command in a shell, returning its exit code and standard output.

Standard error is inherited, not captured. Status is -1 if the process was killed by a signal.