...

Package path

import "k8s.io/utils/path"
Overview
Index

Overview ▾

Variables

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

var ErrInvalidLinkTreatment = errors.New("unknown link behavior")

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 ReadDirNoStat

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

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

type LinkTreatment

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

type LinkTreatment int
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
)