fileutil

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 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 MkdirAll added in v0.6.1

func MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a project-scoped directory tree. Repository directories are intentionally traversable by the owning user and normal development tools.

func OpenFile added in v0.6.1

func OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)

OpenFile opens a project-scoped file path with caller-selected flags.

func PathExists

func PathExists(path string) bool

PathExists checks if a file or directory exists

func ReadFile added in v0.6.1

func ReadFile(path string) ([]byte, error)

ReadFile reads a project-scoped file path. Callers construct these paths from repository configuration, detected package manifests, or temporary files.

func ReadYAMLFile

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

ReadYAMLFile reads and unmarshals a YAML file into the provided interface

func WriteFile added in v0.6.1

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

WriteFile writes a project-scoped file path. Shipyard writes user-visible repository artifacts, so 0644 is an intentional default for many callers.

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