stderr is default piped when using output.

This commit is contained in:
licsber 2024-09-08 11:49:31 +08:00
parent 00e1313980
commit ac182765e2
2 changed files with 6 additions and 3 deletions

View File

@ -3,3 +3,7 @@
unzip all compressed file using unar.
first time write rust executable program~
## Reference
https://rustwiki.org/zh-CN/std/process/struct.Command.html#method.stderr

View File

@ -1,8 +1,8 @@
use std::env;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::env;
use std::process::Command;
fn unar_file(path: &Path) -> io::Result<()> {
println!("UNAR: {}", path.display());
@ -11,7 +11,6 @@ fn unar_file(path: &Path) -> io::Result<()> {
let output = Command::new("unar")
.current_dir(parent_dir)
.arg(filename)
.stderr(Stdio::piped())
.output();
match output {