fileutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fileutil provides shared file utilities used across fizzle packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithFileLock

func WithFileLock(path string, fn func() error) error

WithFileLock acquires an exclusive file lock on path, runs fn while the lock is held, and releases it when fn returns. It errors if the lock stays out of reach for 5 seconds. Lockfiles older than staleLockThreshold clear automatically, so a killed fizzle process can't block later runs for good.

func WriteAtomic

func WriteAtomic(path string, data []byte) error

WriteAtomic writes data to path atomically, through a temp file in the same directory that it then renames, so a partial write never corrupts an existing file. It creates the output directory when missing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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