MCPcopy
hub / github.com/containers/toolbox / PathExists

Function PathExists

src/pkg/utils/utils.go:743–749  ·  view source on GitHub ↗

PathExists wraps around os.Stat providing a nice interface for checking an existence of a path.

(path string)

Source from the content-addressed store, hash-verified

741
742// PathExists wraps around os.Stat providing a nice interface for checking an existence of a path.
743func PathExists(path string) bool {
744 if _, err := os.Stat(path); !errors.Is(err, os.ErrNotExist) {
745 return true
746 }
747
748 return false
749}
750
751// IsContainerNameValid checks if the name of a container matches the right pattern
752func IsContainerNameValid(containerName string) bool {

Callers 4

TestPathExistsFunction · 0.85
IsP11KitClientPresentFunction · 0.85
IsInsideContainerFunction · 0.85
IsInsideToolboxContainerFunction · 0.85

Calls 1

IsMethod · 0.80

Tested by 1

TestPathExistsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…