pathx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) (bool, error)

Exists reports whether path resolves to an existing filesystem object. It follows symbolic links in the same way as os.Stat. A dangling symbolic link is therefore reported as missing.

Exists returns false with a nil error when the lookup fails with fs.ErrNotExist. It preserves every other lookup error.

The result describes only this lookup. It does not protect a later filesystem operation from changes to the path.

func Lstat added in v0.1.0

func Lstat(path string) (fs.FileInfo, bool, error)

Lstat reports whether path names an existing directory entry and returns its metadata. It does not follow the final symbolic link, matching os.Lstat. An existing symbolic link, including a dangling one, is therefore reported as existing and its link metadata is returned.

Lstat returns nil, false, nil when the lookup fails with fs.ErrNotExist. It preserves every other lookup error.

The returned metadata belongs to this lookup. It avoids a second metadata query but does not make a later filesystem operation safe from path changes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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