Search results

There are no results.

std.sys.ChildProcess

class pub ChildProcess

A running or exited child OS process.

Instance methods

stderr

Show source code
Hide source code
fn pub stderr -> Stderr {
  Stderr.new(self)
}
fn pub stderr -> Stderr

Returns a handle to the standard error stream.

stdin

Show source code
Hide source code
fn pub stdin -> Stdin {
  Stdin.new(self)
}
fn pub stdin -> Stdin

Returns a handle to the standard input stream.

stdout

Show source code
Hide source code
fn pub stdout -> Stdout {
  Stdout.new(self)
}
fn pub stdout -> Stdout

Returns a handle to the standard output stream.

try_wait

Show source code
Hide source code
fn pub try_wait -> Result[Option[ExitStatus], Error] {
  match inko_child_process_try_wait(@raw) {
    case { @tag = 0, @value = -1 } -> Result.Ok(Option.None)
    case { @tag = 0, @value = v } -> Result.Ok(Option.Some(ExitStatus.new(v)))
    case { @tag = _, @value = e } -> Result.Error(Error.from_os_error(e))
  }
}
fn pub try_wait -> Result[Option[ExitStatus], Error]

Returns the exit status without blocking.

If the process is still running, a None is returned.

This method doesn't close the STDIN stream before waiting.

wait

Show source code
Hide source code
fn pub wait -> Result[ExitStatus, Error] {
  match inko_child_process_wait(_INKO.process, @raw) {
    case { @tag = 0, @value = v } -> Result.Ok(ExitStatus.new(v))
    case { @tag = _, @value = e } -> Result.Error(Error.from_os_error(e))
  }
}
fn pub wait -> Result[ExitStatus, Error]

Waits for the process to terminate.

The STDIN stream is closed before waiting.

Implemented traits

std.drop.

Drop

impl Drop for ChildProcess