MCPcopy
hub / github.com/httprunner/httprunner / IsFilePathExists

Function IsFilePathExists

hrp/internal/builtin/utils.go:124–137  ·  view source on GitHub ↗

IsFilePathExists returns true if path exists and path is file

(path string)

Source from the content-addressed store, hash-verified

122
123// IsFilePathExists returns true if path exists and path is file
124func IsFilePathExists(path string) bool {
125 info, err := os.Stat(path)
126 if err != nil {
127 // path not exists
128 return false
129 }
130
131 // path exists
132 if info.IsDir() {
133 // path is dir, not file
134 return false
135 }
136 return true
137}
138
139// IsFolderPathExists returns true if path exists and path is folder
140func IsFolderPathExists(path string) bool {

Callers 5

generateGoMethod · 0.92
toTestCaseMethod · 0.92
PathFunction · 0.92
mount.goFile · 0.92
EnsureFolderExistsFunction · 0.85

Calls 2

StatMethod · 0.65
IsDirMethod · 0.45

Tested by

no test coverage detected