Documentation
¶
Overview ¶
Package atomicfile writes files so that readers never observe a partial or mixed state.
It exists because two packages (config, endpoint) need the same write-temp-then-rename discipline, and because the rename step needs a platform-specific retry that neither should have to remember.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteFile ¶
WriteFile writes data to path atomically: the bytes go to a temporary file in the same directory, are flushed, and the temporary file is then renamed over the destination.
perm is applied to the temporary file before the rename, so the destination never exists with wider permissions. On Windows the mode has no effect (ACLs govern access there).
The parent directory is created when missing.
Types ¶
This section is empty.