Documentation
¶
Overview ¶
Package fsutil contains crash-safe file helpers used for all persistent agent state (identity, keys, last-known-good configuration).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SyncDir ¶
SyncDir fsyncs a directory so that entries created, renamed or removed in it survive a power loss. Filesystems that do not support fsync on directories are tolerated.
func WriteFileAtomic ¶
WriteFileAtomic replaces path with data so that concurrent readers and a crash at any point observe either the complete old or the complete new content, never a mix:
- write a temporary file in the same directory,
- set its permissions and fsync it,
- rename it over path,
- fsync the directory so the rename itself is durable.
Types ¶
This section is empty.