Documentation ¶
Overview ¶
Package safeio provides functions to perform atomic, fsync-safe disk operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is an implementation detail of OpenFile.
func OpenFile ¶
OpenFile is the incremental version of WriteToFile. It opens a temp file and proxies writes through to the underlying file.
If Close is called before Commit, the temp file is closed and erased.
If Commit is called before Close, the temp file is closed, fsynced, and atomically renamed to the desired final name.
func (*File) Close ¶
Close closes the current file and erases it, unless Commit was previously called. In that case it does nothing.
Close is idempotent.
After Close is called, Write and Commit will fail.
Click to show internal directories.
Click to hide internal directories.