[silver:util:subprocess]

Contents of [silver:util:subprocess]:

Defined in this grammar:

function spawnProcess   (IOVal<ProcessHandle> ::= cmd::String args::[String] i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 16.

Parameter cmd
The command to run
Parameter args
The arguments to pass to the command (separate from the command)
Parameter i
The IO token
Return
The handle to communicate with the process

Start a subprocess to run in the background with which to communicate. To run cmd a1 a2, call spawnProcess("cmd", ["a1", "a2"])


function sendToProcess   (IOToken ::= p::ProcessHandle msg::String i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 33.

Parameter p
The process to which to send the message
Parameter msg
The message to send to the subprocess
Parameter i
The IO token
Return
The IO token

Send a string message to a subprocess


function readLineFromProcess   (IOVal<String> ::= p::ProcessHandle i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 49.

Parameter p
The process from which to read
Parameter i
The IO token
Return
The line which was read

Read a line of output from a subprocess


function readAllFromProcess   (IOVal<String> ::= p::ProcessHandle i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 66.

Parameter p
The process from which to read
Parameter i
The IO token
Return
The line which was read

Read everything available in the output from a subprocess. Returns an empty string if nothing is available.


function readUntilFromProcess   (IOVal<String> ::= p::ProcessHandle ending::String i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 85.

Parameter p
The process from which to read
Parameter ending
The string to end on
Parameter i
The IO token
Return
The line which was read

Read everything in the stdout from a subprocess until reaching the string “ending”. The ending string is included in the output. If the process never outputs the ending string to stdout, this function never returns.


function readErrLineFromProcess   (IOVal<String> ::= p::ProcessHandle i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 101.

Parameter p
The process from which to read
Parameter i
The IO token
Return
The line which was read

Read a line of output from stderr of a subprocess


function readErrAllFromProcess   (IOVal<String> ::= p::ProcessHandle i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 118.

Parameter p
The process from which to read
Parameter i
The IO token
Return
The line which was read

Read everything available in the stderr from a subprocess. Returns an empty string if nothing is available.


function readErrUntilFromProcess   (IOVal<String> ::= p::ProcessHandle ending::String i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 137.

Parameter p
The process from which to read
Parameter ending
The string to end on
Parameter i
The IO token
Return
The line which was read

Read everything in the stderr from a subprocess until reaching the string “ending”. The ending string is included in the output. If the process never outputs the ending string to stderr, this function never returns.


function waitForProcess   (IOToken ::= p::ProcessHandle i::IOToken )

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 154.

Parameter p
The process for which to wait
Parameter i
The IO token
Return
The IO token

Wait for a running subprocess to end. There should be a reason to expect it to end; this does not kill it.

ffi type ProcessHandle

Contained in grammar [silver:util:subprocess]. Defined at silver/util/subprocess/Subprocess.sv line 4.

(Undocumented.)