commit | 8e8868f630c6431aa08fa926c8c2f6138366a857 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Wed Jun 02 16:50:40 2021 +0000 |
committer | Xin Li <delphij@google.com> | Wed Jun 02 16:50:40 2021 +0000 |
tree | 28ded3e268f7970c9b9a5b9e1dfed07c37063f29 | |
parent | 25d83dc7c4177eb865fb4a100b55dbcf4ab402d2 [diff] | |
parent | ca6837a6eae68a09a8595ee7c72fb946fdaac71e [diff] |
Merge sc-mainline-prod Bug: 189946434 Change-Id: If348f847c31c6a11a988d29f9cadfd7fb48b2ffe
Support for matching file paths against Unix shell style patterns.
To use glob
, add this to your Cargo.toml
:
[dependencies] glob = "0.3.0"
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), } }