Skip to main content

command_to_file

Function command_to_file 

Source
pub fn command_to_file(command: &str, output_file: &File) -> Result<()>
Expand description

Executes a shell command and redirects its standard output to a file.

This function provides a safe wrapper around OS_ShellOutputToFile.

§Arguments

  • command: The shell command string to execute.
  • output_file: An open, writable libcfs::fs::File handle where the command’s output will be written. The file must remain open for the duration of this call.