Process module

Process_Argument_Quoting

enumSource

Whether create_process and run_command put quotes around the arguments they are given. Windows starts a program from one command-line string, so the arguments are joined into it.

QUOTE_IF_NEEDED (the default) quotes an argument that has spaces, tabs, quotes or is empty, with the escaping that most programs (those using the C runtime's rules) undo. NEVER_QUOTE joins the arguments with spaces as they are, for a caller who has built the command line, or whose program has its own rules.

Example
result, out, err, timed_out := run_command("cmd.exe", "/c", "echo", "a", capture_and_return_output = true, timeout_ms = 5000);
assert(!timed_out && result.type == .EXITED);
free(out);
free(err);

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

Members

QUOTE_IF_NEEDED
NEVER_QUOTE

See also