Orca · API

orca.proc

Starting processes: what the scheduler needs to run pipeline binaries.

spawn forks and executes a binary without waiting for it, its output appended to a log file if one is given; reap collects the ones that ended. capture runs a command to the end and returns what it printed. Everything a child needs is prepared before fork, so the child calls only fopen, dup2, execv and _exit.

Functions

spawn

def spawn(argv: List[String], log: String = "") -> Int

Starts argv[0] (a path) with arguments argv, and returns its pid. Its stdout and stderr are appended to log, if given, else shared with this process.

reap

def reap() -> List[Tuple[Int, Int]]

The children that ended, as (pid, exit code), without waiting; a child killed by a signal has code 128 + the signal.

capture

def capture(argv: List[String]) -> Tuple[Int, String]

Runs argv to the end through the shell and returns its exit code and standard output.

absolute

def absolute(path: String) -> String

path, made absolute against the working directory.