Process module

get_process_result

procedureSource

The state of the child as (success, result), waiting up to timeout_ms for it to finish. 0 only checks and -1 (the default) waits for ever. While it runs the result is STILL_RUNNING; afterwards EXITED with the exit code. A process never started is UNSTARTED. success is false when the system could not tell.

get_process_result :: (
    process: *Process,
    timeout_ms := -1
) -> (success: bool, Process_Result)

Parameters

process: *Process
timeout_ms := -1

Returns

success: bool
Example
process: Process;
assert(create_process(*process, "cmd.exe", "/c", "exit 2"));
defer deinit(*process);
ok, result := get_process_result(*process, 5000);
assert(ok && result.type == .EXITED && result.exit_code == 2);

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

See also