[all (rust)] Fix errors in testing input option
- Fix file mode bits checking - Return error reason from stat
This commit is contained in:
@ -5,7 +5,6 @@ use atty::Stream;
|
||||
use clap::{App, Arg};
|
||||
use std::path::Path;
|
||||
use std::process;
|
||||
use std::process::exit;
|
||||
use std::sync::Arc;
|
||||
use thinp::file_utils;
|
||||
use thinp::io_engine::*;
|
||||
@ -80,9 +79,9 @@ fn main() {
|
||||
let matches = parser.get_matches();
|
||||
let input_file = Path::new(matches.value_of("INPUT").unwrap());
|
||||
|
||||
if !file_utils::file_exists(input_file) {
|
||||
eprintln!("Couldn't find input file '{:?}'.", &input_file);
|
||||
exit(1);
|
||||
if let Err(e) = file_utils::is_file_or_blk(input_file) {
|
||||
eprintln!("Invalid input file '{}': {}.", input_file.display(), e);
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
let report;
|
||||
|
Reference in New Issue
Block a user