commit | f159f2a269dc132519220263f2ff926951aa1bf3 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Tue Mar 07 17:23:58 2023 -0800 |
committer | Matthew Maurer <mmaurer@google.com> | Tue Mar 07 17:23:58 2023 -0800 |
tree | 1b1ba7f0a897cdeda990520838f863cbaf2a3276 | |
parent | 424ec153962f3376137f3801ad3a0e93614ddb97 [diff] |
Make glob available to product and vendor Bug: 270690570 Test: mma in external/rust/crates Change-Id: I1392b92626f07818560946655bcd3f543b09a1b2
Support for matching file paths against Unix shell style patterns.
To use glob
, add this to your Cargo.toml
:
[dependencies] glob = "0.3.1"
And add this to your crate root:
extern crate glob;
Print all jpg files in /media/ and all of its subdirectories.
use glob::glob; for entry in glob("/media/**/*.jpg").expect("Failed to read glob pattern") { match entry { Ok(path) => println!("{:?}", path.display()), Err(e) => println!("{:?}", e), } }