Documentation
¶
Overview ¶
Package fsutil holds small filesystem helpers shared by the daemon's packages.
Index ¶
- func CopyTreeNoClobber(src, dst string) (int, error)
- func ReadJSON(path string, v any) (bool, error)
- func RemoveIfExists(path string) (bool, error)
- func ResolveWithin(root, p string) (string, error)
- func Within(root, path string) bool
- func WriteFileAtomic(path string, data []byte, perm os.FileMode) error
- func WriteJSON(path string, v any, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyTreeNoClobber ¶
CopyTreeNoClobber copies src into dst, creating directories and files that don't exist yet and leaving existing ones untouched. Symlinks are recreated as symlinks.
func RemoveIfExists ¶
RemoveIfExists removes path (recursively) and ignores a missing path. It returns whether something was removed.
func ResolveWithin ¶
ResolveWithin resolves p (absolute, or relative to root; a leading "~" means root) and rejects results that escape root, following symlinks on the longest existing prefix.
func WriteFileAtomic ¶
WriteFileAtomic writes data to a temporary file next to path and renames it into place.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.