class

Process

class Process : Obj

Process manages spawning external OS processes.

constructors make

Construct a Process instance used to launch an external OS process with the specified command arguments

fields err

The output stream used to sink the process stderr

in

The input stream used to source the process stdin

mergeErr

If true, then stderr is redirected to the output stream configured via the out field, and the err field is ignored

dir

Working directory of process

command

Command argument list used to launch process

out

The output stream used to sink the process stdout

methods run

Spawn this process

join

Wait for this process to exit and return the exit code

env

Environment variables to pass to new process as a mutable map of string key/value pairs

kill

Kill this process

command Str[] : command

Command argument list used to launch process. The first item is the executable itself, then rest are the parameters.

dir File? : dir

Working directory of process.

env Str:Str env()

Environment variables to pass to new process as a mutable map of string key/value pairs. This map is initialized with the current process environment.

err OutStream? : err

The output stream used to sink the process stderr. Default is to send to Env.err. If set to null, then output is silently consumed like /dev/null. Note this field is ignored if mergeErr is set true, in which case stderr goes to the stream configured via out.

in InStream? : in

The input stream used to source the process stdin. If null, then the new process will block if it attempts to read stdin. Default is null.

join Int join()

Wait for this process to exit and return the exit code. This method may only be called once after run.

kill This kill()

Kill this process. Returns this.

make new make(Str[] cmd, File? dir)

Construct a Process instance used to launch an external OS process with the specified command arguments. The first item in the cmd list is the executable itself, then rest are the parameters.

mergeErr Bool : mergeErr

If true, then stderr is redirected to the output stream configured via the out field, and the err field is ignored. The default is true.

out OutStream? : out

The output stream used to sink the process stdout. Default is to send to Env.out. If set to null, then output is silently consumed like /dev/null.

run This run()

Spawn this process. See join to wait until the process finishes and to get the exit code. Return this.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST