Process spawning
program
- A value representing a child processprogram_output
- Spawns a process, waits for it to exit, and returns the exit code, and contents of stdout and stderr.run_program
- Spawns a process and waits for it to terminatespawn_process
- Run a program, providing stdin, stdout and stderr handlesstart_program
- Spawns a process and returns a programwaitpid
- Waits for a process to exit and returns the exit codeprogram
A value representing a child process
get_id
fn get_id() -> pid_t
Returns the process id of the program
input
fn input() -> io::writer
Returns an io::writer that can be used to write to stdin
output
fn output() -> io::reader
Returns an io::reader that can be used to read from stdout
err
fn err() -> io::reader
Returns an io::reader that can be used to read from stderr
close_input
fn close_input()
Closes the handle to the child processes standard input
finish
fn finish() -> int
Waits for the child process to terminate. Closes the handle to stdin if necessary.
destroy
fn destroy()
Closes open handles
program_output
fn program_output(prog: str, args: ~[str]) ->
{status: int, out: str, err: str,}
Spawns a process, waits for it to exit, and returns the exit code, and contents of stdout and stderr.
A record, {status: int, out: str, err: str} containing the exit code, the contents of stdout and the contents of stderr.
run_program
fn run_program(prog: str, args: ~[str]) -> int
Spawns a process and waits for it to terminate
The process id
spawn_process
fn spawn_process(prog: str, args: ~[str], env: option<~[(str, str)]>,
dir: option<str>, in_fd: c_int, out_fd: c_int, err_fd: c_int)
-> pid_t
Run a program, providing stdin, stdout and stderr handles
The process id of the spawned process
start_program
fn start_program(prog: str, args: ~[str]) -> program
Spawns a process and returns a program
The returned value is a boxed class containing a
A class with a
waitpid
fn waitpid(pid: pid_t) -> int
Waits for a process to exit and returns the exit code