From 75ac0507ce8142ab4105e4067debf79b63ac7e62 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 25 Sep 2016 22:34:38 +0200 Subject: nur kaputte dateien ausgeben diff --git a/src/main.rs b/src/main.rs index ca9b1c5..066a07a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,10 +16,12 @@ fn main() { let base_path = Path::new(&raw_files); for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) { - println!("{:?}", entry.path()); let mut f = File::open(entry.path()).expect("could not open file"); let mut buf = String::new(); - f.read_to_string(&mut buf).unwrap(); + if let Err(e) = f.read_to_string(&mut buf) { + println!("invalid file: {}", entry.path().to_str().unwrap()); + continue; + } let buf = pre_process::strip_irrelevant_content(&buf); } -- cgit v0.10.1