Documentation
¶
Overview ¶
Package atomicfile replaces files so a reader never sees a partial write.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write replaces path with data and perm. It writes a temporary file in the same directory, syncs it, and renames it over path, so a crash leaves either the old file or the new one. The parent directory must exist.
perm is the exact mode of the new file. The umask does not narrow it, as it would for os.WriteFile.
The temporary file is hidden and ends in .tmp, so a directory watcher that skips dotfiles or matches on extension never loads it.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.