Process module

deinit

procedure2 overloadsSource

Releases a Process: closes its pipes and handles and leaves it as a fresh record. Unlike on Unix it does not wait for the child. A child started with kill_process_if_parent_exits (the default) is killed when its job handle closes here; one started without it keeps running. Always call it once per successful create_process.

deinit :: (process: *Process)

Parameters

process: *Process
Example
process: Process;
assert(create_process(*process, "cmd.exe", "/c", "exit 0"));
deinit(*process);
ok, result := get_process_result(*process, 0);
assert(ok && result.type == .UNSTARTED);

Doesn't run in the browser (only on windows).

deinit :: (pipe: *Process.Pipe)

Closes one pipe of a process, for instance process.input so that a child reading its standard input sees the end of the file. The pipe is marked at its end. Safe on a pipe that is already closed.

Parameters

pipe: *Process.Pipe
Example
process: Process;
assert(create_process(*process, "cmd.exe", "/c", "exit 0"));
defer deinit(*process);
deinit(*process.input);
assert(process.input.eof);

Doesn't run in the browser (only on windows).

See also