fileutil

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Overview

Package fileutil provides shared filesystem helpers for AGH components.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPath = errors.New("fileutil: invalid path")

ErrInvalidPath reports a path that cannot be represented safely by the filesystem boundary.

Functions

func AtomicRemoveFile

func AtomicRemoveFile(path string) error

AtomicRemoveFile removes a file and syncs its parent directory.

func AtomicWrite

func AtomicWrite(path string, content []byte) error

AtomicWrite writes content with the default AGH file permissions via temp-file-and-rename.

func AtomicWriteFile

func AtomicWriteFile(path string, content []byte, perm os.FileMode) error

AtomicWriteFile writes content to path via a temp file plus atomic replacement. It always syncs the temp file before replacement. Parent-directory metadata durability remains best-effort on platforms without directory fsync support.

func SyncDir

func SyncDir(path string) error

SyncDir fsyncs directory metadata when the current platform supports it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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