Documentation
¶
Overview ¶
Package atomicfile replaces a file so a reader never observes a partial one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
Write replaces path with data: a temporary file in the same directory, Sync, rename over path, then fsync of the directory. The result is 0600 and the directory is created with 0700 when missing.
func WriteNoSync ¶ added in v0.6.0
WriteNoSync — то же, что Write, но без fsync: атомарная замена (временный файл и rename) сохраняется, а запись не ждёт диска. Цена — падение машины может потерять последнюю запись; годится для восстановимых данных, которые восстанавливаются не из файла: кэш токенов, снимки, метрики.
Types ¶
This section is empty.