Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Do A Glob Search For Files In A Directory With Rust

Basic Recursive Glob

rust
//! ```cargo
//! [dependencies]
//! glob = "0.3.1"
//! ```


use glob::glob;

fn main() {
    for entry in glob("recursive_test/**/*.txt").expect("Failed to read glob pattern") {
        match entry {
            Ok(path) => println!("{:?}", path.display()),
            Err(e) => println!("{:?}", e),
        }
    }
}
results start

The code uses the [TODO: Code shorthand span ] and [TODO: Code shorthand span ] crates which can be installed with :

[TODO: Code shorthand span ] [TODO: Code shorthand span ]

Footnotes And References