Documentation
¶
Overview ¶
Package pathutil resolves filesystem aliases across platforms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
Resolve returns the absolute path of an existing file or directory, following symbolic links and Windows junctions. It does not grant access to that path; callers must still enforce their filesystem boundaries when opening it.
func ResolveExistingPrefix ¶ added in v0.16.7
ResolveExistingPrefix resolves links in the longest existing prefix and appends any missing components. This lets callers check containment before creating an output path. Dangling links are errors, including junctions whose targets no longer exist; they must not be treated as missing directories.
func WalkDir ¶ added in v0.16.7
func WalkDir(root string, visit fs.WalkDirFunc) error
WalkDir follows links in the selected root, including Windows junctions, while preserving the caller's path spelling in callbacks. Like filepath.WalkDir, it does not follow links encountered beneath the root. Directory reads are anchored to an os.Root so a directory replaced by a link during the walk cannot redirect traversal outside the selected root.
Types ¶
This section is empty.