Skip to main content

execute_command_to_file

Function execute_command_to_file 

Source
pub async fn execute_command_to_file(
    executable_path: impl Into<PathBuf>,
    args: &[String],
    timeout: Duration,
    output_path: impl Into<PathBuf>,
) -> Result<ProcessOutput>
Expand description

Executes a command and redirects stdout to a file.

§Arguments

  • executable_path - Path to the executable
  • args - Arguments to pass to the command
  • timeout - Maximum duration to wait for the process
  • output_path - Path to the file where stdout will be written

§Errors

Returns an error if the command fails, times out, or cannot be executed