Logo ProcessKit API Reference

ProcessResult<'T> Type

The full outcome of a run: the exit code as data, captured stdout/stderr, and timing. A non-zero exit is **not** an error here — inspect `Code`/`IsSuccess`, or call `ProcessResult.ensureSuccess` to convert a failure into a `ProcessError`. `'T` is the captured-stdout type: `string` for the text verbs, `byte[]` for the bytes verbs.

Instance members

Instance member Description

this.AcceptedCodes

Full Usage: this.AcceptedCodes

Returns: IReadOnlyList<int>

The exit codes treated as success (from `Command.OkCodes`; `{0}` by default).

Returns: IReadOnlyList<int>

this.Code

Full Usage: this.Code

Returns: int option

The exit code, or `None` for a signal kill or timeout.

Returns: int option

this.Combined

Full Usage: this.Combined

Returns: string

The captured stdout and stderr joined into one string — stdout, then stderr on a new line when both are non-empty (for a `byte[]` stdout, UTF-8-decoded). Shares the exact join rule with `ProcessError.Combined`. This is a **post-hoc concatenation** of the two *separately* captured streams, so it does **not** reproduce their real terminal interleaving. For an honest, byte-for-byte `2>&1` view use `Command.MergeStderr`, which merges the streams at the OS level: the interleaved output then arrives on `Stdout` (and `Stderr` is empty, so `Combined` equals `Stdout`).

Returns: string

this.Duration

Full Usage: this.Duration

Returns: TimeSpan

Wall-clock duration of the run.

Returns: TimeSpan

this.EnsureSuccess

Full Usage: this.EnsureSuccess

Returns: Result<ProcessResult<'T>, ProcessError>

Demand a successful run (an **accepted** exit code — one in `Command.OkCodes`, `{0}` by default): returns the result unchanged on success, otherwise the corresponding `ProcessError` (`Exit` / `Signalled` / `Timeout`). The instance form for C# fluency.

Returns: Result<ProcessResult<'T>, ProcessError>

this.IsSuccess

Full Usage: this.IsSuccess

Returns: bool

True when the process exited with one of the accepted codes (`Command.OkCodes`; `{0}` by default).

Returns: bool

this.IsTimedOut

Full Usage: this.IsTimedOut

Returns: bool

True when the run was killed for exceeding its timeout.

Returns: bool

this.Outcome

Full Usage: this.Outcome

Returns: Outcome

How the run concluded.

Returns: Outcome

this.OutputContainsAny

Full Usage: this.OutputContainsAny

Parameters:
    needles : string seq

Returns: bool

True when any of `needles` appears (case-insensitive, ordinal) in either captured stream — the "a specific non-zero exit is benign when a known stdout/stderr marker is present" idiom (e.g. a tool exiting 1 with `no changes` in its output). Each stream is searched independently, so a needle never matches across the stdout/stderr boundary; a null needle is skipped and an empty `needles` is `false`.

needles : string seq
Returns: bool

this.Program

Full Usage: this.Program

Returns: string

The program that was run.

Returns: string

this.Signal

Full Usage: this.Signal

Returns: int option

The terminating signal, when known.

Returns: int option

this.Stderr

Full Usage: this.Stderr

Returns: string

The captured stderr, as decoded text.

Returns: string

this.Stdout

Full Usage: this.Stdout

Returns: 'T

The captured stdout (decoded text or raw bytes, depending on the verb).

Returns: 'T

this.Truncated

Full Usage: this.Truncated

Returns: bool

True when the captured output was truncated by an output-buffer policy.

Returns: bool

Type something to start searching.