Documentation
¶
Overview ¶
Package replacefile replaces a file with a temporary one written beside it, by renaming the temporary file over it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Rename ¶
Rename renames tmp over dest, which on Unix replaces dest atomically: a concurrent reader or writer never sees a partial or interleaved file. On Windows a rename over a file another process holds open without FILE_SHARE_DELETE fails, and Go's own os.Open does not share delete, so Rename retries a few times there and then returns the error, leaving dest untouched; rewriting it in place instead would bring back the interleaved writes the rename avoids. The caller removes tmp.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.