diff options
author | jan <jan@ruken.pw> | 2016-09-25 20:34:38 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2016-09-25 20:34:38 (UTC) |
commit | 75ac0507ce8142ab4105e4067debf79b63ac7e62 (patch) | |
tree | 3d1af5ae7eefbaeeaae2e89e33b4043503eee745 | |
parent | 265ea9e217f15ef387a5580d9b21a1914308389c (diff) |
nur kaputte dateien ausgeben
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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() { | |||
16 | let base_path = Path::new(&raw_files); | 16 | let base_path = Path::new(&raw_files); |
17 | 17 | ||
18 | for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) { | 18 | for entry in WalkDir::new(base_path).min_depth(1).into_iter().filter_map(|e| e.ok()) { |
19 | println!("{:?}", entry.path()); | ||
20 | let mut f = File::open(entry.path()).expect("could not open file"); | 19 | let mut f = File::open(entry.path()).expect("could not open file"); |
21 | let mut buf = String::new(); | 20 | let mut buf = String::new(); |
22 | f.read_to_string(&mut buf).unwrap(); | 21 | if let Err(e) = f.read_to_string(&mut buf) { |
22 | println!("invalid file: {}", entry.path().to_str().unwrap()); | ||
23 | continue; | ||
24 | } | ||
23 | 25 | ||
24 | let buf = pre_process::strip_irrelevant_content(&buf); | 26 | let buf = pre_process::strip_irrelevant_content(&buf); |
25 | } | 27 | } |