Documentation
¶
Overview ¶
Package fileutils implements some useful functions to work with the file system.
Index ¶
- func CopyDir(source string, dest string) error
- func CopyFile(source string, dest string) error
- func SlashClean(name string) string
- type Dir
- func (d Dir) Copy(src, dst string) error
- func (d Dir) Mkdir(name string, perm os.FileMode) error
- func (d Dir) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (d Dir) RemoveAll(name string) error
- func (d Dir) Rename(oldName, newName string) error
- func (d Dir) Stat(name string) (os.FileInfo, error)
- func (d Dir) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶
CopyDir copies a directory from source to dest and all of its sub-directories. It doesn't stop if it finds an error during the copy. Returns an error if any.
func SlashClean ¶
SlashClean is equivalent to but slightly more efficient than path.Clean("/" + name).
Types ¶
type Dir ¶
type Dir string
A Dir uses the native file system restricted to a specific directory tree. Originally from ttps://github.com/golang/net/blob/master/webdav/file.go An empty Dir is treated as ".".
func (Dir) Copy ¶
Copy copies a file or directory from src to dst. If it is a directory, all of the files and sub-directories will be copied.
Click to show internal directories.
Click to hide internal directories.