← back to roto on ba3a.dev

SystemProcessRunner

Runs programs as operating-system processes. Stdout and stderr are drained at the same time, so a program that fills one pipe while Roto reads the other can never stall. If the calling thread is interrupted while waiting, the process is killed rather than left running.

Functions

Link copied to clipboard
open override fun run(command: List<String>, workingDirectory: Path?): ProcessResult

Runs command (the program, then its arguments) in workingDirectory — Roto's own when null — with no input, and waits for it to exit. Throws an IOException when the program cannot be started, for example because it is not on PATH; a program that starts and then fails is a ProcessResult with a non-zero exit code.