Skip to main content

bounded_command

Function bounded_command 

Source
pub fn bounded_command(
    argv: &[String],
    input: Vec<u8>,
    timeout: Duration,
    maximum: usize,
) -> Result<(ExitStatus, Vec<u8>, Vec<u8>)>
Expand description

Runs argv without a shell in its own process group, writes input to its standard input, and returns its exit status, standard output and standard error. Fails with TimedOut after timeout, and when either stream exceeds maximum bytes. The group is killed when the command ends.