ProcessStdin Type
A handle for writing to a running child's standard input interactively. Obtained from `RunningProcess.TakeStdin` when the command was built with `Command.Stdin` / `Command.KeepStdinOpen`. Call `FinishAsync` to close stdin (the child sees end-of-file). Each write accepts an optional `CancellationToken`: a child that stops reading fills the stdin pipe and blocks the write, so a token lets the caller bound how long it waits (a cancelled write throws `OperationCanceledException`, the .NET convention for a cancelled `Task`). As with any cancellable stream write, a cancelled write may already have delivered *some* of its bytes to the child, so the safe recovery from a timed-out interactive write is to abandon the session — not to retry the write, which would duplicate the delivered prefix.
Instance members
| Instance member |
Description
|
|
Close the child's stdin — the child sees end-of-file. Idempotent (safe to call more than once, or after the run's own teardown has closed stdin), mirroring `IAsyncDisposable.DisposeAsync`. Uncancellable by the same convention: closing flushes any buffered input, which a full pipe can block — to bound an interactive session, cancel the `WriteAsync`/`WriteLineAsync`/`FlushAsync` calls above before closing rather than the close itself.
|
|
|
Full Usage:
this.WriteAsync
Parameters:
byte[]
?cancellationToken : CancellationToken
Returns: Task
|
Write raw bytes to the child's stdin. `bytes` must not be null (`ArgumentNullException` — a C# caller that forgets a null check would otherwise see a raw `NullReferenceException`).
|
Full Usage:
this.WriteLineAsync
Parameters:
string
?cancellationToken : CancellationToken
Returns: Task
|
Write a line of UTF-8 text followed by `\n`. `text` must not be null (`ArgumentNullException`).
|
ProcessKit API Reference