atomicfile

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(path string) (release func(), err error)

Lock acquires an exclusive advisory flock on path. The lockfile is intentionally never removed — unlinking the inode while another process is in flock races with concurrent acquirers.

func Write

func Write(target string, data []byte, mode os.FileMode) error

Write atomically replaces target via a sibling tempfile + rename. Parent dir must exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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