dir-iterator
Iterator that recursively scans and filters files from a directory.
Usage
Installation
Start using this library by running the following command in your cargo project directory.
cargo add dir-iterator
Read a Directory Recursively
use dir_iterator::*
fn main() {
DirIterator::new(".")
.expect("path not found")
.flatten()
.for_each(|e| println!("{:?}",e.file_name()));
}
Filter Result with Wildcards
use dir_iterator::*
fn main() {
DirIterator::new(".")
.expect("path not found")
.flatten()
.filter(wildcard("*.txt"))
.for_each(|e| println!("{:?}",e.file_name()));
}