pathutil

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pathutil centralizes filesystem containment checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFileWithin

func ReadFileWithin(root, target string) ([]byte, error)

ReadFileWithin reads target through an open handle to root. The rooted read follows symlinks only while they remain inside root, so validation and use cannot be separated by a pathname race.

func Within

func Within(root, target string) bool

Within reports whether target is root itself or a lexical descendant of root. The separator boundary matters: a valid child named "..prod" is not the parent marker "..".

Types

This section is empty.

Jump to

Keyboard shortcuts

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