Scoop API

scoop:scoop.platform:0.1.0

ChildProcess

class ChildProcess

source · line 36
public
public class ChildProcess internal constructor(
    inputPipe: Boolean,
    outputPipe: Boolean,
    errorPipe: Boolean
) : Closeable

An owned child process and any untaken pipe endpoints. Close closes retained pipes and waits for termination; it does not automatically kill a running process.

function tryWait

source · line 121
public
public fun tryWait(): ExitStatus?

Returns a final status if available, or None while the child is still running.

function takeStderr

source · line 108
public
public fun takeStderr(): PipeSource?

Transfers ownership of the child's error pipe to the caller and removes it from automatic child cleanup.

function terminate

source · line 178
public
public fun terminate(): Unit

Requests SIGTERM on POSIX or TerminateProcess with exit code 1 on Windows.

function takeStdin

source · line 90
public
public fun takeStdin(): PipeSink?

Transfers ownership of the child's input pipe to the caller and removes it from automatic child cleanup.

function takeStdout

source · line 99
public
public fun takeStdout(): PipeSource?

Transfers ownership of the child's output pipe to the caller and removes it from automatic child cleanup.

function close

source · line 285
public
public override fun close(): Unit

Closes retained pipe endpoints and waits for the child, preserving cleanup failures. Taken endpoints remain the caller's responsibility.

function communicate

source · line 222
public
public fun communicate(timeout: Duration, input: List<Byte>? = None): ProcessOutput

Uses one monotonic timeout for input, both outputs, and process exit. Negative durations leave the pipes untouched. On timeout, closes the pipes, kills and reaps the owned child, and throws ProcessTimeoutException with the bytes collected so far. Descendant processes are not managed. Cleanup and OS scheduling can delay return beyond the timeout.