Skip to main content

Crate minifind

Crate minifind 

Source
Expand description

minifind is a minimal, parallel find(1) reimplementation.

The crate is split into a thin binary (main.rs) and this library so the traversal pipeline can be driven through a public API and exercised by integration tests. run spawns a dedicated output thread, walks every requested path in parallel via walk::walk_parallel, filters entries by file type / glob / regex, and writes matched paths to a caller-supplied sink.

§Examples

use minifind::args::Args;
use std::io;

let args = Args::default();
minifind::run(&args, || io::stdout().lock()).unwrap();

Modules§

args
filetype
glob
interrupt
meta
Metadata predicates — the find-style filters that require a stat: -size, -mtime/-ctime/-atime (+ -mmin/-cmin/-amin), -perm, -uid/-gid, and -user/-group.
ratelimit
Global I/O rate limiter for the walker, wrapping governor.
regex
sched
--idle scheduling (Linux): SCHED_IDLE + IOPRIO_CLASS_IDLE for the walker pool (per worker) plus nice +19 process-wide, so a heavy walk yields the CPU and disk to other work.
walk
Custom parallel filesystem walker: a crossbeam-deque work-stealing engine over a cfg-split leaf (unix/fallback).

Functions§

raise_nofile_limit
Raises the soft RLIMIT_NOFILE to the hard limit, giving the walker headroom for its pinned-parent-fd frontier (≈ O(workers × depth)), as find/fd do. Best-effort; returns the resulting soft limit (None = unlimited).
run
Runs the pipeline: parallel walk → filter by type/glob/regex → write matched paths.