Documentation
¶
Index ¶
- Constants
- func CopyBuffered(r io.Reader, w io.Writer) error
- func CopyFile(src, dst string) error
- func DirExists(path string) bool
- func FileExists(path string) bool
- func GetCWD() string
- func GetName(path string) (string, bool)
- func NextAvailablePath(path string, ext ...string) string
- func PathExists(path string) bool
- func SanitizePath(value string) string
- type Entry
- type Type
Constants ¶
const ( DirectoryPermission = 0700 // Default directory permissions given on creation FilePermission = 0644 // Default file permissions given on creation )
Variables ¶
This section is empty.
Functions ¶
func CopyBuffered ¶
CopyBuffered copies the input io.Reader to the given output io.Writer using a buffer of 32KB
func DirExists ¶
DirExists returns true if the specified path exists AND is a directory, false otherwise
func FileExists ¶
FileExists returns true if the specified path exists AND is a file, false otherwise
func GetCWD ¶
func GetCWD() string
GetCWD returns the path a string of the given current working directory
func NextAvailablePath ¶
NextAvailablePath returns the next available path for the given path, optionally with an extension For files without an extension or directories, the extension can be omitted In case an extension is provided, but it does not match the intended path, it will be ignored Example: NextAvailablePath("foo.png") -> "foo.png" if foo.png does not exist
NextAvailablePath("foo.png", ".png") -> "foo1.png" if foo.png does exist
NextAvailablePath("foo.png", ".png") -> "foo12.png" if foo1.png - foo11.png do exist
func PathExists ¶
PathExists returns true if the specified path exists, false otherwise
func SanitizePath ¶
SanitizePath - Sanitize string so it can be used as a valid file name