Function spawn

Source
pub fn spawn<D: AsRef<Path>, P: AsRef<OsStr> + Debug, A: AsRef<OsStr> + Debug>(
    in_directory: D,
    cmd: P,
    arguments: &[A],
    set_env: &[(&str, &str)],
    captures: Capturing,
) -> Result<Child>
Expand description

Run cmd with arguments and the env overridden with the key-value pairs in set_env, return a Child handle (does not wait for its completion). If you don’t want to capture outputs, pass Captures::none() to captures. Note: if you just want to run a process in the background and are not actually reading from the filehandles in Child, then you definitely want to set this to Captures::none(), because otherwise the outputs will go nowhere, or even block the child process after filling the pipe buffer.