atomicfile

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package atomicfile writes a file so a crash mid-write never leaves it truncated: content goes to a temp file in the SAME directory, is fsync'd, then renamed over the target (an atomic operation on POSIX). Load-bearing state files (config.json, plan snapshots, job meta, checkpoint manifests) use this so a power loss / SIGKILL can't brick the project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFile

func WriteFile(path string, data []byte, perm os.FileMode) error

WriteFile atomically writes data to path with the given permissions. On any failure the original file (if any) is left untouched and the temp file is cleaned up.

Types

This section is empty.

Jump to

Keyboard shortcuts

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