Documentation
¶
Overview ¶
Package atomicfile replaces files so a reader, or the next run after a crash, sees either the old content or the new, never a mix.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write replaces path with data through a temporary file in the same directory, synced before the rename. A replaced file keeps its permission bits; a new one gets the mode os.Create gives it, under the umask. A symlink at path itself is replaced, never written through, and its replacement is no more open than the file it pointed at, when that file exists. Symlinks among path's parent directories are followed as usual. The directory must exist. The temporary file is hidden and ends in .tmp, so a reader that lists the directory by the target's extension skips one a killed run left behind, and the next Write of path removes it.
Types ¶
This section is empty.