Documentation ¶
Index ¶
- func CleanFilename(in string) string
- func CleanPath(path string) string
- func CopyFile(from, to string) error
- func CopyFileForce(from, to string) error
- func FileContains(path, needle string) bool
- func IsDir(path string) bool
- func IsEmptyDir(path string) (bool, error)
- func IsFile(path string) bool
- func Shred(path string, runs int) error
- func Umask() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanFilename ¶
CleanFilename strips all possibly suspicious characters from a filename WARNING: NOT suiteable for pathnames as slashes will be stripped as well!
func CopyFile ¶ added in v1.14.1
CopyFile copies a file from src to dst. Permissions will be preserved. It is expected to fail if the destination does exist but is not writeable.
func CopyFileForce ¶ added in v1.14.1
CopyFileForce copies a file from src to dst. Permissions will be preserved. The destination if removed before copying to avoid permission issues.
func FileContains ¶ added in v1.12.6
FileContains searches the given file for the search string and returns true iff it's an exact (substring) match.
func IsDir ¶
IsDir checks if a certain path exists and is a directory. https://stackoverflow.com/questions/10510691/how-to-check-whether-a-file-or-directory-denoted-by-a-path-exists-in-golang
func IsEmptyDir ¶
IsEmptyDir checks if a certain path is an empty directory.
Types ¶
This section is empty.