Help us shape the future of Go! Take the 2026 Go Developer Survey

filesystem

package
v0.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaseKey added in v0.7.0

func CaseKey(path string) string

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

func CheckSafeDirectory(targetDir string, allowSystem bool) error

CheckSafeDirectory verifies directory can be modified by CHEST. Returns an error if target is a system directory and allowSystem is false.

func EnsureDir

func EnsureDir(dir string) error

EnsureDir creates directory and parents if not exist

func Exists

func Exists(path string) bool

Exists checks if path exists

func IsDirectory

func IsDirectory(path string) bool

IsDirectory checks if path is a directory

func IsSystemPath

func IsSystemPath(targetPath string) (bool, string)

IsSystemPath returns true if target path is a root volume, drive root, or OS system directory.

func MoveFile

func MoveFile(src, dst string) error

MoveFile safely moves a file from src to dst. First tries os.Rename. If cross-device error occurs, copies then deletes source.

func ResolveCollision

func ResolveCollision(dst string) string

ResolveCollision generates a non-conflicting filename by appending (1), (2), etc.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL