Crate globwalk

source ·
Expand description

Recursively find files in a directory using globs.

Features include


Finding image files in the current directory.

extern crate globwalk;

use std::fs;

for img in globwalk::glob("*.{png,jpg,gif}")? {
    if let Ok(img) = img {

Advanced Globbing

By using one of the constructors of globwalk::GlobWalker, it is possible to alter the base-directory or add multiple patterns.

extern crate globwalk;

use std::fs;

let walker = globwalk::GlobWalkerBuilder::from_patterns(
        &["*.{png,jpg,gif}", "!Pictures/*"],

for img in walker {


  • Possible file type filters. Constants can be OR’d to filter for several types at a time.
  • Error from parsing globs.
  • An iterator which emits glob-matched patterns.
  • An iterator for recursively yielding glob matches.


  • Construct a new GlobWalker with a glob pattern.
  • Construct a new GlobWalkerBuilder with a glob pattern.

Type Aliases