fileutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fileutil contains the CLI's owner-only file replacement primitive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(ctx context.Context, path string) (func(), error)

Lock takes an exclusive lock between processes by creating path, waiting while another process holds it. The returned function releases it.

func WriteFile

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

WriteFile replaces path with data without exposing a partially written file. It creates new directories with mode 0700 and the replacement with mode 0600. Callers remain responsible for coordinating read-modify-write transactions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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