Documentation
¶
Overview ¶
Package atomicfile provides crash-safe atomic file writes for CLI state and configuration files via a same-directory temporary file, fsync, and rename.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Perm os.FileMode // mode for a new file (and always, unless PreserveMode)
PreserveMode bool // keep an existing target's permission bits
MkdirPerm os.FileMode // when non-zero, MkdirAll(dir, MkdirPerm) first
SyncDir bool // fsync the directory after rename (best-effort)
}
Options configures an atomic file write.
Click to show internal directories.
Click to hide internal directories.