rust-ape-example/src/bin/std_misc_process.rs
ahgamut 4b8d56098f uncomment some of the threads examples
they don't run yet because of some stack size thing
2022-09-08 09:49:12 +05:30

28 lines
553 B
Rust

// ./src/std_misc/process.md
use std::process::Command;
fn part0() {
let output = Command::new("rustc")
.arg("--version")
.output().unwrap_or_else(|e| {
panic!("failed to execute process: {}", e)
});
if output.status.success() {
let s = String::from_utf8_lossy(&output.stdout);
print!("rustc succeeded and stdout was:\n{}", s);
} else {
let s = String::from_utf8_lossy(&output.stderr);
print!("rustc failed and stderr was:\n{}", s);
}
}
pub fn main() {
part0();
}