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