safefs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenExisting

func OpenExisting(path string, flag int) (*os.File, error)

OpenExisting opens path without following any symlink in the parent components or final leaf. Refuses non-regular and hardlinked leaves via requireRegularFD so reads through this entry point cannot cross the file-tool boundary onto an outside-of-project inode.

func OpenForWrite

func OpenForWrite(path string, perm os.FileMode) (*os.File, bool, error)

OpenForWrite opens an existing regular file for replacement or creates a missing leaf. Missing parent directories are created through checked no-follow traversal. The returned bool reports whether the file existed.

func RemoveLeaf

func RemoveLeaf(path string) error

RemoveLeaf removes only the final path entry. A symlink leaf is unlinked as a symlink; it is never followed. Hardlinked regular and symlink leaves are refused so snapshot-created-file deletes cannot mutate outside-boundary link state.

Types

This section is empty.

Jump to

Keyboard shortcuts

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