fileutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package fileutil provides file I/O utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFileAtomic

func WriteFileAtomic(destPath string, data []byte, perm os.FileMode) error

WriteFileAtomic writes data to destPath atomically using a temp-file + fsync + rename pattern. If destPath already exists, its permissions are preserved; otherwise perm is used.

The temp file is created in the same directory as destPath so that the final os.Rename is guaranteed to be atomic on POSIX filesystems.

Types

This section is empty.

Jump to

Keyboard shortcuts

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