process stderr.
This commit is contained in:
parent
42411d7324
commit
00e1313980
@ -1,7 +1,7 @@
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::env;
|
||||
|
||||
fn unar_file(path: &Path) -> io::Result<()> {
|
||||
@ -11,6 +11,7 @@ fn unar_file(path: &Path) -> io::Result<()> {
|
||||
let output = Command::new("unar")
|
||||
.current_dir(parent_dir)
|
||||
.arg(filename)
|
||||
.stderr(Stdio::piped())
|
||||
.output();
|
||||
|
||||
match output {
|
||||
@ -32,7 +33,7 @@ fn is_compressed(path: &Path) -> bool {
|
||||
if let Some(ext) = path.extension() {
|
||||
if let Some(ext) = ext.to_str() {
|
||||
let ext = ext.to_lowercase();
|
||||
return ext == "zip" || ext == "rar";
|
||||
return ext == "zip" || ext == "rar" || ext == "7z";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user