fsops

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package fsops provides filesystem operations with OS-appropriate implementations. On POSIX the operations are thin wrappers over the standard library; on Windows they add cmd/PowerShell fallbacks for the cases where the Win32 layer rejects an operation the Go runtime issued (e.g. RemoveAll on a directory containing a junction).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkdirAll

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

MkdirAll creates a directory path and all missing parents.

func Remove

func Remove(path string) error

Remove removes a single file or empty directory.

func RemoveAll

func RemoveAll(path string) error

RemoveAll removes path and any children it contains.

func WriteFile

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

WriteFile writes data to path, creating it if necessary.

func WriteFileAtomic

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

WriteFileAtomic writes data to path atomically: a temp file in the same directory is written and closed, then renamed into place, so a concurrent reader never observes a partial file. The parent directory must already exist. The resulting file carries os.CreateTemp's owner-only mode (0600), matching the prior sidecar writers; callers needing a different mode chmod the final path themselves.

This is the single atomic-write primitive shared by the YAML sidecar writers (scoring, review/labels) and the lockfile writer; callers marshal their own bytes and hand them here rather than re-implementing temp+rename.

Types

This section is empty.

Jump to

Keyboard shortcuts

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