flix

0.69.2

Sys.Process

eff ProcessSource

An effect used to start a process outside the JVM.

Operations

def execWithCwdAndEnv(cmd: String, args: List[String], cwd: Option[String], env: Map[String, String]): Result[IoError, ProcessHandle] \ Process Source

Immediately executes the command cmd with the arguments args, by the path cwd and with the environment env.

def exitValue(ph: ProcessHandle): Result[IoError, Int32] \ Process Source

Returns the exit value of the process ph.

def isAlive(ph: ProcessHandle): Result[IoError, Bool] \ Process Source

Returns whether the process ph is alive.

def pid(ph: ProcessHandle): Result[IoError, Int64] \ Process Source

Returns the PID of the process ph.

def stderr(ph: ProcessHandle): Result[IoError, StdErr] \ Process Source

Returns the stderr stream of the process ph.

def stdin(ph: ProcessHandle): Result[IoError, StdIn] \ Process Source

Returns the stdin stream of the process ph.

def stdout(ph: ProcessHandle): Result[IoError, StdOut] \ Process Source

Returns the stdout stream of the process ph.

def stop(ph: ProcessHandle): Result[IoError, Unit] \ Process Source

Stops the process ph.

def waitFor(ph: ProcessHandle): Result[IoError, Int32] \ Process Source

Waits for the process ph to finish and returns its exit value.

def waitForTimeout(ph: ProcessHandle, time: Int64, tUnit: TimeUnit): Result[IoError, Bool] \ Process Source

Waits at most time (in the given tUnit) for the process ph to finish. Returns true if the process exited, false if the timeout elapsed.

Definitions

def exec(cmd: String, args: List[String]): Result[IoError, ProcessHandle] \ Process Source

Executes the command cmd with the arguments args.

def execWithCwd(cmd: String, args: List[String], cwd: Option[String]): Result[IoError, ProcessHandle] \ Process Source

Executes the command cmd with the arguments args, by the path cwd.

def execWithEnv(cmd: String, args: List[String], env: Map[String, String]): Result[IoError, ProcessHandle] \ Process Source

Executes the command cmd with the arguments args and with the environmental env.

def handle(f: a -> b \ ef): a -> b \ (ef - Process) + IO Source

Handles the Process effect of the given function f.

In other words, re-interprets the Process effect using the IO effect.

@DefaultHandler
def runWithIO(f: Unit -> a \ ef): a \ (ef - Process) + IO Source

Runs the Process effect of the given function f.

In other words, re-interprets the Process effect using the IO effect.