Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicWriter ¶
type AtomicWriter struct {
// contains filtered or unexported fields
}
func NewAtomicWriter ¶
func NewAtomicWriter(f string) (*AtomicWriter, error)
NewAtomicWriter returns an io.WriteCloser that will write contents to a temp file and move that temp file to the destination filename. If the destination filename already exists, this constructor will copy the file to <filename>-old, truncating that file if it already exists.
func (*AtomicWriter) Close ¶
func (a *AtomicWriter) Close() error
Close closes the temp file handle and moves the temp file to the final destination. Multiple calls to Close will have no effect after the first success.
Click to show internal directories.
Click to hide internal directories.