atomicfile

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package atomicfile writes a file atomically: a temp file in the destination directory, then a rename, so a crash mid-write never leaves a truncated file. It is the single home for the temp-write-rename dance the profile store and the serve daemon's snapshot store both need.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

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

Write creates data at path atomically with the given file permission. The destination directory must already exist. On any failure the temp file is removed and the original path is left untouched.

Types

This section is empty.

Jump to

Keyboard shortcuts

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