fileutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomicWrite

func AtomicWrite(path string, data []byte, perm os.FileMode) error

AtomicWrite writes data to a file atomically using a temp file + rename This ensures the file is either fully written or not written at all

func EnsureDir

func EnsureDir(path string) error

EnsureDir creates a directory and all parent directories if they don't exist

func IsDir

func IsDir(path string) bool

IsDir checks if the path exists and is a directory

func PathExists

func PathExists(path string) bool

PathExists checks if a file or directory exists

func ReadYAMLFile

func ReadYAMLFile(path string, v interface{}) error

ReadYAMLFile reads and unmarshals a YAML file into the provided interface

func WriteYAMLFile

func WriteYAMLFile(path string, v interface{}, perm os.FileMode) error

WriteYAMLFile marshals the provided interface to YAML and writes it atomically

Types

This section is empty.

Jump to

Keyboard shortcuts

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