MCPcopy
hub / github.com/puma/puma-dev / FileExists

Function FileExists

dev/devtest/testutils.go:187–193  ·  view source on GitHub ↗

FileExists returns true if a regular file exists at the given path.

(filename string)

Source from the content-addressed store, hash-verified

185
186// FileExists returns true if a regular file exists at the given path.
187func FileExists(filename string) bool {
188 info, err := os.Stat(filename)
189 if os.IsNotExist(err) {
190 return false
191 }
192 return !info.IsDir()
193}
194
195// DirExists returns true if a directory exists at the given path.
196func DirExists(dirname string) bool {

Calls

no outgoing calls