stderr is default piped when using output.
This commit is contained in:
parent
00e1313980
commit
ac182765e2
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user