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 ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.