stat_cache
stat_cache
#
What identifies a file without reading it, and remembering its hash for as long as that holds.
Learned = tuple[Path, Stat, ContentHash]
#
A file's path, its stat when hashed, and the hash.
Batch
#
A hash cache that holds what a walk learns until flush, remembering it in one write.
Source code in capturegraph-lib/capturegraph/scratch/hashing/stat_cache.py
HashCache
#
Bases: Protocol
Remembers a file's hash for as long as its Stat is unchanged.
Source code in capturegraph-lib/capturegraph/scratch/hashing/stat_cache.py
NoCache
#
A hash cache that remembers nothing.
Source code in capturegraph-lib/capturegraph/scratch/hashing/stat_cache.py
lookup(path, stat)
#
Stat
dataclass
#
A file's identity on disk: change any of these and its content may have changed.
Source code in capturegraph-lib/capturegraph/scratch/hashing/stat_cache.py
of(path)
classmethod
#
The stat of path itself (a symlink is not followed).