Documentation ¶
Overview ¶
Package fileutils provides useful, high-level file operations
Index ¶
- func CopyDir(src string, dst string) error
- func CopyFile(src string, dst string) error
- func IsDir(dirname string) bool
- func IsFile(filename string) bool
- func ListFiles(directory string) (list []string, err error)
- func SanitizePath(s string) string
- func TempFileName(dir, pattern string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies a file from source to dest. Any existing file will be overwritten and attributes will not be copied
func SanitizePath ¶ added in v0.2.0
SanitizePath removes invalid characters from path
func TempFileName ¶ added in v0.2.0
TempFileName returns a new temporary file name in the directory dir. The filename is generated by taking pattern and adding a random string to the end. If pattern includes a "*", the random string replaces the last "*". If dir is the empty string, TempFileName uses the default directory for temporary files (see os.TempDir). Multiple programs calling TempFileName simultaneously will not choose the same file name. some code borrowed from stdlib https://golang.org/src/io/ioutil/tempfile.go
Types ¶
This section is empty.