From 00e131398013986fd5bc267fe11a6b6b393a35c4 Mon Sep 17 00:00:00 2001 From: licsber Date: Sun, 8 Sep 2024 11:41:33 +0800 Subject: [PATCH] process stderr. --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 432b4a8..9fc1bc4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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"; } }