Documentation
¶
Overview ¶
Package atomicfile replaces files whole and durably: the content goes to a uniquely named temporary file beside the target, which is synced and renamed over it, and then the directory is synced so the rename survives a crash. A reader sees the old file or the new one and never a partial write, and concurrent writers never share a temporary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write replaces path with what write produces, with permissions perm. On a failure before the rename path is untouched and the temporary is removed; a failure to sync the directory after it is reported with path already replaced.
func WriteSeekable ¶
WriteSeekable is Write for a producer that seeks back over what it wrote, as a muxer patching its header does: write is handed the temporary itself, unbuffered.
Types ¶
This section is empty.