classafFpm::Process2
sys::Obj afFpm::Process2
Process manages spawning external OS processes. Goes one better than the standard sys::Process as this constantly stream keyboard input to the new process.
- actorPool
ActorPool? actorPoolThe
ActorPoolused to control the in / out / err stream threads. Leave asnullto create a defaultActorPool.- command
Str[] commandCommand argument list used to launch process. The first item is the executable itself, then rest are the parameters.
- dir
File? dirWorking directory of process.
- env
Environment variables to pass to new process as a mutable map of string key/value pairs. This map is initialised with the current process environment.
- err
OutStream? err := Env.cur().err- in
InStream? in := nullThe 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.- isAlive
Bool isAlive()- 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 := Str[,], File? dir := null)Construct a Process instanced used to launch an external OS process with the specified command arguments. The first item in the
cmdlist is the executable itself, then rest are the parameters.- mergeErr
Bool mergeErr := trueIf true, then stderr is redirected to the output stream configured via the
outfield, and theerrfield is ignored. The default is true.- out
OutStream? out := Env.cur().outThe 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 has finished and get the exit code. Return this.