filesystem

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomicWriteFile

func AtomicWriteFile(
	path string,
	perm os.FileMode,
	write func(io.Writer) error,
) error

AtomicWriteFile safely replaces a file using a temporary file and an atomic rename.

The temporary file is created in the destination directory to ensure the rename operation is atomic on the same filesystem.

On success, the destination file is either completely replaced or left untouched if an error occurs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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