Documentation ¶
Overview ¶
Package fileutil implements some basic functions for file operations
Index ¶
- func ClearFile(path string) error
- func CopyFile(srcFilePath string, dstFilePath string) error
- func CreateFile(path string) bool
- func FileMode(path string) (fs.FileMode, error)
- func IsDir(path string) bool
- func IsExist(path string) bool
- func IsLink(path string) bool
- func ListFileNames(path string) ([]string, error)
- func MiMeType(file interface{}) string
- func ReadFileByLine(path string) ([]string, error)
- func ReadFileToString(path string) (string, error)
- func RemoveFile(path string) error
- func UnZip(zipFile string, destPath string) error
- func Zip(fpath string, destPath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListFileNames ¶
ListFileNames return all file names in the path
func MiMeType ¶ added in v1.1.8
func MiMeType(file interface{}) string
MiMeType return file mime type param `file` should be string(file path) or *os.File
func ReadFileByLine ¶ added in v1.0.6
ReadFileByLine read file line by line
func ReadFileToString ¶ added in v1.0.6
ReadFileToString return string of file content
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.