field

package
v0.0.47-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLinkTreatment = errs.New("unknown link behavior")

ErrInvalidLinkTreatment indicates that the link treatment behavior requested is not a valid behavior.

Functions

func Exists

func Exists(linkBehavior LinkTreatment, filename string) (bool, error)

Exists checks if specified file, directory, or symlink exists. The behavior of the test depends on the linkBehaviour argument. See LinkTreatment for more details.

func OutDir

func OutDir(path string) (string, error)

OutDir creates the absolute path name from path and checks if the path exists and is a directory. Returns absolute path including trailing '/' or error if the path does not exist or is not a directory.

func ReadDirNoStat

func ReadDirNoStat(dirname string) ([]string, error)

ReadDirNoStat returns a string of files/directories contained in dirname without calling lstat on them.

Types

type LinkTreatment

type LinkTreatment int

LinkTreatment is the base type for constants used by Exists that indicate how symlinks are treated for existence checks.

const (
	// CheckFollowSymlink follows the symlink and verifies that the target of
	// the symlink exists.
	CheckFollowSymlink LinkTreatment = iota

	// CheckSymlinkOnly does not follow the symlink and verifies only that they
	// symlink itself exists.
	CheckSymlinkOnly
)

Jump to

Keyboard shortcuts

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