#fnmatch #glob #wildmatch

filenamegen

Shell-style filename generation aka globbing

8 releases

0.2.7 Aug 25, 2024
0.2.6 May 13, 2024
0.2.4 Apr 14, 2020

#233 in Science

Download history 878/week @ 2026-01-19 1988/week @ 2026-01-26 2050/week @ 2026-02-02 5540/week @ 2026-02-09 2613/week @ 2026-02-16 1967/week @ 2026-02-23 2158/week @ 2026-03-02 3084/week @ 2026-03-09 3972/week @ 2026-03-16 4295/week @ 2026-03-23 3001/week @ 2026-03-30 2777/week @ 2026-04-06 2815/week @ 2026-04-13 2832/week @ 2026-04-20 3150/week @ 2026-04-27 2432/week @ 2026-05-04

11,447 downloads per month
Used in 5 crates (via wezterm-ssh)

MIT license

36KB
827 lines

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

Dependencies

~2.4–5.5MB
~91K SLoC