atomic

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package atomic provides atomic file write helpers built on tmp-file + fsync + rename, the only primitive stdlib gives us for crash-safe writes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(path string, data []byte) error

WriteFile writes data to path atomically. Permissions are 0o644.

func WriteFileFrom

func WriteFileFrom(path string, r io.Reader) error

WriteFileFrom copies from r to path atomically with mode 0o644.

func WriteFileMode

func WriteFileMode(path string, data []byte, mode os.FileMode) error

WriteFileMode is WriteFile with an explicit mode.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL