Expand description
Unified filesystem walker — traverses a union of roots once and classifies files into audio/daw/preset/pdf buckets by extension.
§Why
Running 4 separate walkers (audio, daw, preset, pdf) over overlapping roots
(~, /Applications, /Volumes/*) re-walks the same directories 4x.
On SMB shares, each readdir/stat is a network roundtrip — re-walks cost
minutes. This module walks each subtree exactly once.
§How
- Union the per-type root sets.
- Walk each unique root in parallel via rayon, dedup-visited by canonical path.
- For every file entry, classify by lowercase extension against each type’s
extension set AND the type’s root-membership predicate. A file at
~/foo.wavis audio if~/foo.wavsits under at least oneaudio_rootsentry (for typical setups, this is trivially true). - DAW packages (
.logicx,.banddirectories) are detected at directory level and treated as projects; their subtree is NOT descended. - Plugin bundles (
.vst3,.component, etc.) are skipped entirely for DAW, but their interiors ARE still walked for audio/preset/pdf content. - Symlinks:
readdirdoes not mark symlink targets as files/dirs; each symlink isstated and classified by its target (broken symlinks skipped).
Per-type progress callbacks stream batches as they’re discovered.
Structs§
- Incremental
DirState - Snapshot + in-scan updates for incremental directory skipping (
scan_unifiedand standalone per-type walkers). Persisted in SQLite under domain"unified"so all scan modes share one mtime map. - Unified
Counts - Running totals across all types.
- Unified
Spec - Per-type scanning configuration. Empty roots disables the type (no output).
Enums§
- Classified
Batch - One classified batch sent to the on_batch callback.
Constants§
- DAW_
BACKUP_ 🔒DIRS - DAW_
EXTENSIONS 🔒 - DAW_
PACKAGE_ 🔒EXTENSIONS - DAW_
PLUGIN_ 🔒BUNDLE_ EXTENSIONS - PDF_
EXTENSION 🔒 - PRESET_
EXTENSIONS 🔒
Functions§
- daw_
name_ 🔒for_ format - dir_
mtime_ 🔒secs - directory_
incremental_ 🔒key - Same path key string as visit deduplication:
canonicalizewhen possible, else normalized original. - ext_
match 🔒 - Does the lowercased filename end with any of
exts?extsmust include the leading dot. - fmt_
mtime_ 🔒ymd - Format a UNIX timestamp (seconds since epoch) as “YYYY-MM-DD” in UTC. Returns empty string for invalid/zero timestamps.
- format_
size 🔒 - get_
directory_ 🔒size - get_
directory_ 🔒size_ depth - is_
network_ 🔒path - Quick check: is this path likely on a network share? Network mounts can be anywhere (not just /Volumes/ or /mnt/), so fall back to statfs(2) which is authoritative on macOS.
- is_
valid_ 🔒band_ package - network_
fs_ 🔒type - normalize_
macos_ 🔒path - under_
any_ 🔒root - Membership predicate — does
pathlive under any root inroots? Empty roots list means “no files qualify for this type”. - walk_
dir_ 🔒parallel - walk_
unified - Walk the union of all roots across types, emitting classified batches.