Documentation
¶
Index ¶
- func CaseKey(path string) string
- func CheckSafeDirectory(targetDir string, allowSystem bool) error
- func EnsureDir(dir string) error
- func Exists(path string) bool
- func IsDirectory(path string) bool
- func IsSystemPath(targetPath string) (bool, string)
- func MoveFile(src, dst string) error
- func ResolveCollision(dst string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaseKey ¶ added in v0.7.0
CaseKey returns a map key for path such that two spellings of the same destination share a key on case-insensitive platforms, which is how intra- plan collision detection avoids treating "Photo.jpg" and "photo.jpg" as distinct targets.
func CheckSafeDirectory ¶
CheckSafeDirectory verifies directory can be modified by CHEST. Returns an error if target is a system directory and allowSystem is false.
func IsSystemPath ¶
IsSystemPath returns true if target path is a root volume, drive root, or OS system directory.
func MoveFile ¶
MoveFile safely moves a file from src to dst. First tries os.Rename. If cross-device error occurs, copies then deletes source.
func ResolveCollision ¶
ResolveCollision generates a non-conflicting filename by appending (1), (2), etc.
Types ¶
This section is empty.