Function command_to_file

Source
pub fn command_to_file(
    command: &mut Command,
    file: File,
    stderr_file: Option<File>,
) -> Result<(), CmdSpawnError>
Expand description

spawn, wait and send the stdout of the command to a file

ยงErrors

command_to_file can result in CmdSpawnError:

  • CmdSpawnError::IO(std::io::Error) when spawn or wait fail
  • CmdSpawnError::Child(ChildError) when the child process exit with a failed status