Skip to content

Engine → Core → process.h

process_desc

Syntax

struct process_desc

Variables

AccessNameTypeDefaultDescription
publicargumentsstd::vector<std::string>{}argv[1..] of the child, unquoted. An argument containing a NUL character is INVALID_ARGUMENT.
publiccaptureStderrbooltrueCapture the child's standard error into process_result::standardError. When false the child inherits the parent's standard error.
publiccaptureStdoutbooltrueCapture the child's standard output into process_result::standardOutput. When false the child inherits the parent's standard output.
publicenvironmentstd::vector<std::pair<std::string, std::string>>{}Variables added to, or overriding, the inherited environment. A pair with an empty value removes the variable. Names are case-insensitive on Windows; an empty name, one containing '=' or a NUL character in a name or value is INVALID_ARGUMENT.
publicexecutablestd::string{}Path of the program, or a bare name searched in the inherited PATH (and, on Windows, the parent's directory). A relative path is resolved against the parent's current directory, not against workingDirectory. On Windows a .bat or .cmd file (any case, also spelt with trailing dots or spaces) is INVALID_ARGUMENT because cmd.exe would re-parse the arguments; a NUL character is INVALID_ARGUMENT everywhere.
publicmergeStderrboolfalseSend the child's standard error into the standard output stream so the two are interleaved in process_result::standardOutput. Requires captureStdout.
publictimeoutSecondsf640Wall-clock limit for the whole run, including the time the child's descendants keep its captured output open. When exceeded the child (and every process it spawned) is killed and process_result::timedOut is set. 0 means no limit. Must be finite and not negative; values above process::MAX_TIMEOUT_SECONDS behave like that maximum.
publicworkingDirectorystd::filesystem::path{}Current directory of the child. Empty inherits the parent's. Must exist.