Documentation
¶
Overview ¶
Package atomicfile writes files that are never observed half-written.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write replaces path with data atomically: into a sibling temp file first, then renamed into place. rename(2) is atomic on POSIX, so a crash or a concurrent reader sees either the old file or the new one, never a truncated half of the new one. The file is created 0600 — every caller here holds per-user state, and the temp file inherits os.CreateTemp's mode without a separate chmod step.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.