filenamegen

Crates.iofilenamegen
lib.rsfilenamegen
version0.2.7
sourcesrc
created_at2020-04-11 22:34:45.448755
updated_at2024-08-25 23:15:36.162176
descriptionShell-style filename generation aka globbing
homepage
repositoryhttps://github.com/wez/wzsh
max_upload_size
id228777
size36,487
Wez Furlong (wez)

documentation

https://docs.rs/filenamegen

README

filenamegen

Filename Generation, aka Globbing.

This crate implements shell style file name generation a.k.a.: globbing. The provided globber can expand globs relative to a specified directory (or just the current working directory). filenamegen tries to avoid walking down paths that will never match a glob in order to reduce pressure on the underlying filesystem.

This simple example recursively finds all of the rust source files under the current directory.

use filenamegen::Glob;

fn main() -> anyhow::Result<()> {
  let glob = Glob::new("**/*.rs")?;
  for path in glob.walk(std::env::current_dir()?) {
    println!("{}", path.display());
  }
  Ok(())
}

License: MIT

Commit count: 325

cargo fmt