aboutsummaryrefslogtreecommitdiff
path: root/src/filecounter.rs
blob: 3532fa3b56df2c148c0269f265c4e4c6b4dd4c19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use walkdir::*;

/// Function to count the number of entries in a directory.
/// Is needed to get a progress.
pub fn filecount(path : &str) -> u64 {
    let mut counter : u64 = 0;
    for _ in WalkDir::new(path).into_iter().filter_map(|e| e.ok()) {
        counter += 1;
    }

    counter
}