MCPcopy
hub / github.com/GopeedLab/gopeed / IsExistsFile

Function IsExistsFile

pkg/util/path.go:174–181  ·  view source on GitHub ↗

IsExistsFile check file exists and is a file

(path string)

Source from the content-addressed store, hash-verified

172
173// IsExistsFile check file exists and is a file
174func IsExistsFile(path string) bool {
175 info, err := os.Stat(path)
176 // if file exists and is a file
177 if err == nil && !info.IsDir() {
178 return true
179 }
180 return false
181}
182
183const (
184 // MaxFilenameLength is the maximum length in bytes for a filename

Callers 1

TestIsExistsFileFunction · 0.85

Calls 1

StatMethod · 0.80

Tested by 1

TestIsExistsFileFunction · 0.68