public static execute( commandLine as List<String>, inputString as String = null, timeout as ULong = 0ul, inheritError as Boolean = false ) as ProcessResults
Executes a command line.
| Parameter | Description |
|---|---|
commandLine | Command and arguments. |
inputString | Optional standard input payload (null by default). The text is encoded as UTF-8 without changing whitespace, line endings or embedded U+0000 characters. |
timeout | Maximum execution time in milliseconds. A value of zero disables timeout enforcement. |
inheritError | Send child standard error directly to the parent's standard error instead of capturing it. Useful for interactive progress; the child retains the terminal width and can observe console resizes. |
A typed ProcessResults object.
result = Process.execute(["klyn", "--version"], timeout=5_000ul) assert not result.timedOut assert result.exitCode == 0 # Let an external tool display its progress live on standard error. result = Process.execute(["curl", "--progress-bar", "--output", "page.html", "https://example.com"], inheritError=true)