Documentation ¶
Index ¶
- Constants
- func CopyDir(dst, src string, skip func(path string) bool) error
- func CopyFile(source, dest string) error
- func CreateDirIfNotExist(dirPath string) error
- func IsDir(path string) (bool, error)
- func IsFile(path string) (bool, error)
- func IsFileOrDirExist(path string) bool
- func OutDir(path string) (string, error)
- func RenamePath(oldPath, newPath string) error
- func SameFile(a, b string) (bool, error)
Constants ¶
const (
Slash = "/"
)
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶ added in v0.11.0
CopyDir recursively copies all the files within the directory given in src to the directory given in dst.
Both directories should already exist. If the destination directory is non-empty then the new files will merge in with the old, overwriting any files that have a relative path in common between source and destination.
func CreateDirIfNotExist ¶
CreateDirIfNotExist creates dir recursively if not exist Note: input argument must be a dirPath
func IsFileOrDirExist ¶
IsFileOrDirExist checks whether a file or a dir exists
func OutDir ¶
OutDir returns an absolute representation of path after dir check Returns absolute path including trailing '/' or error if path does not exist.
func RenamePath ¶
RenamePath renames (moves) oldPath to newPath, and creates needed directories in newPath If newPath already exists, RenamePath will return an error
func SameFile ¶ added in v0.11.0
SameFile returns true if the two given paths refer to the same physical file on disk, using the unique file identifiers from the underlying operating system. For example, on Unix systems this checks whether the two files are on the same device and have the same inode.
Types ¶
This section is empty.