barrel_p2p_file (barrel_p2p v0.1.0)

View Source

Summary

Functions

Atomically write Data to Path with 0600 permissions. Writes through a Path ++ ".tmp" shadow, chmods the empty file to 0600, then writes the payload and renames. Cleans up the temp file on any failure.

Functions

write_secure(Path, Data)

-spec write_secure(file:name_all(), iodata()) -> ok | {error, term()}.

Atomically write Data to Path with 0600 permissions. Writes through a Path ++ ".tmp" shadow, chmods the empty file to 0600, then writes the payload and renames. Cleans up the temp file on any failure.