Documentation
¶
Index ¶
- Constants
- func CheckDirEmpty(path string) (bool, error)
- func CleanCreateDir(path string) error
- func CleanDir(path string) error
- func ConvertPathsToRelative(baseDir string, paths []string) error
- func CopyFile(dst, src string, perm os.FileMode) error
- func CopyFileToDir(dstDir, src string, perm os.FileMode) error
- func CopyRecursive(dstDir, src string, cb fs.WalkDirFunc) error
- func CreateDir(path string) error
- func MoveFile(dst, src string, perm os.FileMode) error
- func MoveFileToDir(dstDir, src string, perm os.FileMode) error
Constants ¶
const DefaultDirPerms fs.FileMode = 0o755
DefaultDirPerms is the default permission used when creating directories.
Variables ¶
This section is empty.
Functions ¶
func CheckDirEmpty ¶
CheckDirEmpty checks if the directory is empty.
func CleanCreateDir ¶
CleanCreateDir deletes the given dir and then re-creates it.
func ConvertPathsToRelative ¶
ConvertPathsToRelative converts a list of paths to relative. Enforces that none of the paths are below the base dir. Deduplicates the list of paths.
func CopyFileToDir ¶
CopyFileToDir copies the file to the dir maintaining the filename.
func CopyRecursive ¶
func CopyRecursive(dstDir, src string, cb fs.WalkDirFunc) error
CopyRecursive copies regular files & directories from src to dest.
Calls the callback with the absolute path to the source file. Ignore not-exist src dir by doing nothing.
func CreateDir ¶ added in v1.30.0
CreateDir creates the given dir if it doesn't exist. Uses os.MkdirAll with default permissions defined by DefaultDirPerms.
Types ¶
This section is empty.