MCPcopy Index your code
hub / github.com/containerd/containerd / atomicDelete

Function atomicDelete

core/runtime/v2/bundle.go:160–170  ·  view source on GitHub ↗

atomicDelete renames the path to a hidden file before removal

(path string)

Source from the content-addressed store, hash-verified

158
159// atomicDelete renames the path to a hidden file before removal
160func atomicDelete(path string) error {
161 // create a hidden dir for an atomic removal
162 atomicPath := filepath.Join(filepath.Dir(path), fmt.Sprintf(".%s", filepath.Base(path)))
163 if err := os.Rename(path, atomicPath); err != nil {
164 if os.IsNotExist(err) {
165 return nil
166 }
167 return err
168 }
169 return os.RemoveAll(atomicPath)
170}

Callers 1

DeleteMethod · 0.85

Calls 2

DirMethod · 0.80
RemoveAllMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…