package
1.33.0-alpha.2
Repository: https://github.com/kubernetes/kubernetes.git
Documentation: pkg.go.dev
# Functions
DirExists returns true if a directory exists at `path`, false if `path` does not exist, otherwise an error.
EnsureDir ensures that a directory exists at `path`, and if it must create the directory any necessary parent directories will also be created and the new directory will be empty.
EnsureFile ensures that a regular file exists at `path`, and if it must create the file any necessary parent directories will also be created and the new file will be empty.
FileExists returns true if a regular file exists at `path`, false if `path` does not exist, otherwise an error.
ReplaceDir replaces the contents of the dir at `path` with `files` by writing to a tmp dir in the same dir as `path` and renaming the tmp dir over `path`.
ReplaceFile replaces the contents of the file at `path` with `data` by writing to a tmp file in the same dir as `path` and renaming the tmp file over `path`.
WriteTempDir creates a temporary dir at `path`, writes `files` into it, and fsyncs all the files The keys of `files` represent file names.
WriteTmpFile creates a temporary file at `path`, writes `data` into it, and fsyncs the file Expects the parent directory to exist.