Add counter when is_file()
parent
0351adc51f
commit
4cb09cd6a9
17
src/main.rs
17
src/main.rs
|
@ -165,19 +165,22 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
for entry in WalkDir::new(&args.output).into_iter().filter_map(|e| e.ok()) {
|
let mut i = 0;
|
||||||
//println!("[O] {}", entry.path().display());
|
for entry in WalkDir::new(&args.output)
|
||||||
|
.into_iter()
|
||||||
|
.filter_map(|e| e.ok())
|
||||||
|
{
|
||||||
// symlink_metadata does not follow symlink :-]
|
// symlink_metadata does not follow symlink :-]
|
||||||
let metadata = fs::symlink_metadata(entry.path()).unwrap();
|
let metadata = fs::symlink_metadata(entry.path()).unwrap();
|
||||||
let ft = metadata.file_type();
|
let ft = metadata.file_type();
|
||||||
|
|
||||||
if ft.is_file() {
|
if ft.is_file() {
|
||||||
//println!("[I] Name: {}", entry.path().display());
|
|
||||||
|
|
||||||
if let Ok(mut file) = fs::File::open(&entry.path()) {
|
if let Ok(mut file) = fs::File::open(&entry.path()) {
|
||||||
process::<Sha256, _>(&mut file,
|
process::<Sha256, _>(&mut file,
|
||||||
&format!("{}", entry.path().display()));
|
&format!("[{}] - {}",
|
||||||
|
i,
|
||||||
|
entry.path().display()));
|
||||||
|
i = i+1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue