MCPcopy
hub / github.com/dgraph-io/dgraph / fileExists

Function fileExists

dgraphtest/dgraph.go:64–73  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

62)
63
64func fileExists(filename string) (bool, error) {
65 info, err := os.Stat(filename)
66 if err != nil && !os.IsNotExist(err) {
67 return false, errors.Wrap(err, "error while getting file info")
68 }
69 if err != nil && os.IsNotExist(err) {
70 return false, nil
71 }
72 return !info.IsDir(), nil
73}
74
75type dnode interface {
76 cname() string

Callers 2

setupBinaryMethod · 0.70
ensureFileMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected