Expand description
Filesystem + JSON helpers shared by the collectors.
Functions§
- dir_
basename - Last path component of a working directory (
/a/b/app→app), orNone. - env_
path - A non-empty environment variable as a path.
- modified_
since falseonly when the file’s mtime is known and older thanstart— cheap pre-filter so untouched history is never parsed.- num
- A JSON number as
u64: accepts integers and floats, clamps negatives to 0. - num_any
- First of
keyspresent inobjas a number (aliases across versions). - num_f
- An optional JSON number (already deserialised as
f64) asu64: clamps negatives and NaN to 0. Used by the typed per-line parsers. - project_
from_ dirname -Users-me-Projects-app-→Users-me-Projects-app.- read_
lines - Stream the lines of a (possibly huge) file; invalid UTF-8 lines are skipped.
- split_
paths - Split a path-list environment value (
:/;/,separated). - walk_
ext - Recursively collect files below
rootwhose extension is one ofexts(case-sensitive, without the dot). Unreadable directories are skipped.