Documentation
¶
Overview ¶
Package atomicfile provides atomic file write primitives. The goal is that after a successful WriteFile call, readers either see the full new content or the full previous content — never a partial / truncated file caused by a crash, OS reboot, disk-full, or SIGKILL halfway through the write.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteFile ¶
WriteFile atomically writes data to the file named by path. It writes to a temp file in the same directory (so the final rename is atomic on the same filesystem), fsyncs the temp file, then renames it over path. On any error the temp file is removed.
perm is applied to the final file via chmod after creation; on Unix the resulting file ignores umask, matching os.WriteFile semantics.
Types ¶
This section is empty.