pub struct ProcessConfig<'a> {
pub program: &'a CString,
pub args: &'a [CString],
pub env: Option<&'a [(&'a CString, &'a CString)]>,
pub cwd: Option<&'a CString>,
pub stdin: StdioContainer,
pub stdout: StdioContainer,
pub stderr: StdioContainer,
pub extra_io: &'a [StdioContainer],
pub uid: Option<uint>,
pub gid: Option<uint>,
pub detach: bool,
}Data needed to spawn a process. Serializes the std::io::process::Command
builder.
Fields
program | Path to the program to run.
|
args | Arguments to pass to the program (doesn't include the program itself).
|
env | Optional environment to specify for the program. If this is None, then
it will inherit the current process's environment.
|
cwd | Optional working directory for the new process. If this is None, then
the current directory of the running process is inherited.
|
stdin | Configuration for the child process's stdin handle (file descriptor 0).
This field defaults to CreatePipe(true, false) so the input can be
written to.
|
stdout | Configuration for the child process's stdout handle (file descriptor 1).
This field defaults to CreatePipe(false, true) so the output can be
collected.
|
stderr | Configuration for the child process's stdout handle (file descriptor 2).
This field defaults to CreatePipe(false, true) so the output can be
collected.
|
Any number of streams/file descriptors/pipes may be attached to this
process. This list enumerates the file descriptors and such for the
process to be spawned, and the file descriptors inherited will start at
3 and go to the length of this array. The first three file descriptors
(stdin/stdout/stderr) are configured with the stdin, stdout, and
stderr fields.
|
uid | Sets the child process's user id. This translates to a setuid call in
the child process. Setting this value on windows will cause the spawn to
fail. Failure in the setuid call on unix will also cause the spawn to
fail.
|
gid | Similar to uid, but sets the group id of the child process. This has
the same semantics as the uid field.
|
detach | If true, the child process is spawned in a detached state. On unix, this
means that the child is the leader of a new process group.
|