fsutil

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotRegularFile = fmt.Errorf("not a regular file")

ErrNotRegularFile is returned when a path exists but is not a regular file.

Functions

func IsRegularFile

func IsRegularFile(path string) bool

IsRegularFile returns true if path exists and is a regular file.

func OpenRegularFile

func OpenRegularFile(path string) (*os.File, error)

OpenRegularFile opens path only if it is a regular file (not a symlink, dir, etc.). Uses Lstat→Open→Fstat(SameFile) to prevent TOCTOU symlink-swap attacks.

func ReadRegularFile

func ReadRegularFile(path string) ([]byte, error)

ReadRegularFile reads path only if it is a regular file (not a symlink, dir, etc.).

Types

This section is empty.

Jump to

Keyboard shortcuts

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