MCPcopy Create free account
hub / github.com/containers/image / removeDirContents

Function removeDirContents

directory/directory_dest.go:285–297  ·  view source on GitHub ↗

deletes the contents of a directory

(path string)

Source from the content-addressed store, hash-verified

283
284// deletes the contents of a directory
285func removeDirContents(path string) error {
286 files, err := os.ReadDir(path)
287 if err != nil {
288 return err
289 }
290
291 for _, file := range files {
292 if err := os.RemoveAll(filepath.Join(path, file.Name())); err != nil {
293 return err
294 }
295 }
296 return nil
297}

Callers 1

newImageDestinationFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…