Documentation
¶
Overview ¶
Package atomicfile wraps os.File to allow atomic file updates.
All writes will go to a temporary file. Close the file when you are done writing to atomically make the changes visible. Abort to discard all your writes. This allows a file to be in a consistent state and never expose an in-progress write.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicRename ¶
AtomicRename atomically renames (moves) oldpath to newpath. It is guaranteed to either replace the target file entirely, or not change either file.
Types ¶
type File ¶
File behaves like os.File, but does an atomic rename operation at Close.
func New ¶
New creates a new temporary file that will replace the file at the given path when Closed.
Click to show internal directories.
Click to hide internal directories.