Expand description
uv-style global content-addressable store (CAS) engine.
Blobs live under <cas_root>/sha1/<xx>/<full_sha1_hash> and are linked
into target directories through a strategy cascade: hardlink → NTFS
junction (Windows) → symlink → plain copy, so deduplication never breaks
downstream consumers (e.g. game launches). Fully generic: no game,
launcher or Minecraft terms anywhere in the public API.
Structs§
- CasStats
- Live CAS stats: number of stored blobs and their total size in bytes.
- Dedupe
Report - Outcome of
deduplicate_dirs: scanned files, replaced files and approximate bytes the duplicates consumed before linking. - GcReport
- Outcome of
cas_garbage_collect_dirs. - Ingest
Result - Result of
ingest_file: the blob hash and whether the blob already existed in the CAS.
Enums§
Functions§
- blob_
path - cas_
garbage_ collect_ dirs - Removes CAS blobs that no active directory references. The referenced set is recomputed by hashing files, so deletion is safe for linked consumers too.
- cas_
stats - Scans
<cas_root>/sha1and returns the blob count + total size. - deduplicate_
dirs - Deduplicates files across
dirs: ingests every candidate into the CAS, then replaces the duplicate copies with links (temp-link + rename; a failure never loses a file). ANoneextension list matches all files. - ingest_
file - Streams
srcinto the CAS, hashing while reading; atomic rename into place when the blob is new. Reuses an existing blob if another ingest won the race, so concurrent ingests converge instead of failing. - link_
or_ copy - Links (or copies)
cas_blobtodest.destmust not exist yet. The cascade is hardlink → NTFS junction (Windows) → symlink → copy, so the worst case is always a real copy. Returns the winning strategy so callers and diagnostics can report the true cost.