Skip to main content
function Child.kill
def Child.kill() -> None
Forces the child process to exit. If the child has already exited, its a no-op. This is equivalent to sending a SIGKILL on Unix platforms. function Child.stderr
def Child.stderr() -> std.io.Readable
The handle for reading from the child’s standard error (stderr), if it has been captured. Calling this function more than once will yield error. function Child.stdin
def Child.stdin() -> std.io.Writable
The handle for writing to the child’s standard input (stdin), if it has been captured. Calling this function more than once will yield error. function Child.stdout
def Child.stdout() -> std.io.Readable
The handle for reading from the child’s standard output (stdout), if it has been captured. Calling this function more than once will yield error. function Child.try_wait
def Child.try_wait() -> typing.Any
Non-blocking check for child exit. Returns None if the child is still running, or ExitStatus if it has exited. Does not consume the child — stdout/stderr stream accessors remain callable after this returns a status, allowing pipe contents to be drained via child.stdout().readototstring() etc. function Child.wait
def Child.wait() -> std.process.ExitStatus
Waits for the child to exit completely, returning the status that it exited with. This function will continue to have the same return value after it has been called at least once. The stdin handle to the child process, if any, will be closed before waiting. This helps avoid deadlock: it ensures that the child does not block waiting for input from the parent, while the parent waits for the child to exit. function Child.wait_with_output
def Child.wait_with_output() -> std.process.Output
WARNING: Calling wait_with_output consumes the child instance, causing errors on subsequent calls to other methods. Simultaneously waits for the child to exit and collect all remaining output on the stdout/stderr handles, returning an Output instance. The stdin handle to the child process, if any, will be closed before waiting. This helps avoid deadlock: it ensures that the child does not block waiting for input from the parent, while the parent waits for the child to exit. By default, stdin, stdout and stderr are inherited from the parent. In order to capture the output into this Result<Output> it is necessary to create new pipes between parent and child. Use stdout('piped') or stderr('piped'), respectively. property Child.id
Child.id: int
Returns the OS-assigned process identifier associated with this child.