#walk #directory #parallel

collectfiles

Collects accurate files while running in parallel through directories. (Simple, Fast, Powerful)

2 stable releases

1.1.0 Dec 3, 2021
1.0.0 Oct 19, 2021

#1426 in Filesystem

MIT/Apache

12KB
204 lines

collectfiles


Collects accurate files while running in parallel through directories. (Simple, Fast, Powerful)

CI Crates.io Licensed Twitter

| Docs | Latest Note |

[dependencies]
collectfiles = "1.1.0"

Example

use collectfiles::*;

let vec = CollectFiles("/Users/hwakyeom/programs/")
        .with_depth(1)
        .with_target_regex(".md$")
        .with_hook(|path| path.with_extension("mutated"))
        .with_unwrap_or_else(|e| {
            if e.kind() == io::ErrorKind::NotFound {
                PathBuf::from("/Users/other/")
            } else {
               panic!("{:?}", e)
            }
        })
        .collect();

println!("{:#?}", vec);

Dependencies

~3.5–4.5MB
~80K SLoC