atomicfile

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

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

Write atomically replaces path with data. Creates parent directories if needed. Uses temp file in same directory + fsync + rename. Cleans up temp file on any error. Preserves the existing file's permission bits when the target already exists. New files are created with mode 0o644 (world- readable), matching the convention used throughout gale for config files, lock files, and generated README files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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