Documentation
¶
Index ¶
- Constants
- func CopyFile(src string, dst string) (err error)
- func CreateDirectory(dirPath string) error
- func DeleteFile(filePath string) error
- func DeleteFiles(filePaths ...string)
- func GetSys(info os.FileInfo) (*syscall.Stat_t, bool)
- func IsDir(name string) bool
- func IsRegularFile(name string) bool
- func Link(src string, linkName string) error
- func LoadYaml(path string, out interface{}) error
- func Md5Sum(name string) string
- func MoveFile(src string, dst string) error
- func MoveFileAfterCheckMd5(src string, dst string, md5 string) error
- func OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func PathExist(name string) bool
- func SymbolicLink(src string, target string) error
Constants ¶
View Source
const BufferSize = 8 * 1024 * 1024
BufferSize define the buffer size when reading and writing file
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
CreateDirectory creates directory recursively.
func IsRegularFile ¶
IsRegularFile reports whether the file is a regular file. If the given file is a symbol link, it will follow the link.
func MoveFileAfterCheckMd5 ¶
MoveFileAfterCheckMd5 will check whether the file's md5 is equals to the param md5 before move the file src to dst.
func OpenFile ¶
OpenFile open a file. If the parent directory of the file isn't exist, it will create the directory.
func PathExist ¶
PathExist reports whether the path is exist. Any error get from os.Stat, it will return false.
func SymbolicLink ¶
SymbolicLink creates target as a symbolic link to src.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.