ferralk 1.1.0

Glob matching and parallel filesystem walking, byte-first, with an unsafe-free matcher.
Documentation

ferralk

ferralk finds files. Give it a glob such as {src,packages}/**/*.{ts,tsx} and it walks the tree in parallel, applies .gitignore the way Git does, and opens only the directories the pattern can reach. It re-exports ferralk-glob, so walker patterns and standalone matchers use the same component-aware language.

use std::error::Error;

use ferralk::{ErrorPolicy, WalkOptions, Walker};

let result = Walker::new(".")
    .include("src/**/*.rs")?
    .exclude("**/generated/**")?
    .respect_git_ignore(true)
    .threads(4)
    .error_policy(ErrorPolicy::Collect)
    .options(WalkOptions::default().files_only(true).sort(true))
    .collect()?;

// `collect()?` succeeded, but that does not mean the walk did: under the
// default `ErrorPolicy::Collect` even a root that does not exist is reported
// in `errors()` below rather than as `Err`.
for entry in result.entries() {
    println!("{}", entry.path().display());
}

for error in result.errors() {
    // `Display` names the operation and path; `source()` says why it failed.
    match error.source() {
        Some(cause) => eprintln!("{error}: {cause}"),
        None => eprintln!("{error}"),
    }
}
# Ok::<(), Box<dyn std::error::Error>>(())

Paths remain native Path values throughout traversal; use WalkEntry::path_bytes() only when passing a path to a byte-first matcher. Hidden-entry matching, symlink following, Git ignores, metadata, and sorting are off until asked for, and recoverable errors are collected next to the entries by default. Portable std::fs traversal is the default, with optional native Linux and macOS backends for platform-specific performance work.

See the crate documentation for the full API and tested recipes (Git ignore rules, include and exclude lists, stopping early, errors, async use), the usage guide for every default and switch, and the Ferralk repository for benchmarks, compatibility, and development documentation.

ferralk is part of the Ferramenta family — A family of Rust tools.

Siblings: ferroni — Oniguruma-compatible regex engine · ferriki — Shiki-compatible syntax highlighting · ferromark — Markdown to HTML with a secure default and every GFM extension included. · ferrolex — Spell checking for text and code · ferrocat — Translation catalog engine · palamedes — Internationalization for TypeScript applications · ferrovia — SVGO-compatible SVG optimizer · ferrugo — PDF previews for untrusted files.

Built by Sebastian Software.