package containerfs

import "github.com/dotcloud/docker/internal/containerfs"

Index

Functions

func EnsureRemoveAll

func EnsureRemoveAll(dir string) error

EnsureRemoveAll wraps os.RemoveAll to check for specific errors that can often be remedied. Only use EnsureRemoveAll if you really want to make every effort to remove a directory.

Because of the way os.Remove (and by extension os.RemoveAll) works, there can be a race between reading directory entries and then actually attempting to remove everything in the directory. These types of errors do not need to be returned since it's ok for the dir to be gone we can just retry the remove operation.

This should not return a os.ErrNotExist kind of error under any circumstances.

Source Files

rm.go

Version
v28.1.1+incompatible (latest)
Published
Apr 18, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
6 hours ago

Tools for package owners.