MCPcopy Create free account
hub / github.com/brimdata/super / checkPath

Method checkPath

pkg/storage/file.go:109–127  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

107}
108
109func (f *FileSystem) checkPath(path string) error {
110 dir := filepath.Dir(path)
111 if dir == "." {
112 return nil
113 }
114 f.existsMu.RLock()
115 _, ok := f.exists[dir]
116 f.existsMu.RUnlock()
117 if ok {
118 return nil
119 }
120 if err := os.MkdirAll(dir, 0755); err != nil {
121 return err
122 }
123 f.existsMu.Lock()
124 f.exists[dir] = struct{}{}
125 f.existsMu.Unlock()
126 return nil
127}
128
129func fileErr(err error) error {
130 if os.IsNotExist(err) {

Callers 2

PutMethod · 0.95
PutIfNotExistsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected