Ancora.TempName (ancora v1.0.0)

Copy Markdown View Source

Cross-VM collision-proof suffixes for temp file and directory names.

System.unique_integer/1 is unique only within one BEAM VM. Nested or parallel ancora runs share tmp locations, so a VM-local counter lets one run's cleanup delete, truncate, overwrite, or misparse another run's in-flight temp file.

The OS pid separates concurrently live VMs; the random suffix covers pid reuse against stale same-name leftovers.

Summary

Functions

Returns a <os-pid>_<12-hex-chars> suffix safe across concurrent VMs.

Functions

cross_vm_suffix()

@spec cross_vm_suffix() :: String.t()

Returns a <os-pid>_<12-hex-chars> suffix safe across concurrent VMs.