fsatomic

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package fsatomic performs symlink-safe atomic file replacement for the installer's preference and confirmed-state files.

A write uses one same-directory create-exclusive temp, flushes the bytes, atomically renames over the destination, and flushes the parent directory. The live process best-effort removes only the exact temp it created. A crash orphan is never scanned, deleted, reused, or treated as recovery input; a later save allocates a fresh random temp and the committed file remains authoritative.

The destination must be a regular file or absent. A symlink or other unsafe destination type fails before any write, so a hostile link can never redirect a Pasture write outside the intended path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFile

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

WriteFile atomically replaces path with data at the given mode. The parent directory must already exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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