atomicwrite

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package atomicwrite provides a POSIX-atomic file writer: data is written to a temp file in the target's directory, fsync'd, then renamed over the target.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

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

Write atomically writes data to path. It creates a temp file in the same directory as path, writes data, fsyncs the temp file before closing it, then renames the temp file over path. The temp file is removed on any error so a failed write never leaves partial state behind.

Types

This section is empty.

Jump to

Keyboard shortcuts

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