Documentation ¶
Index ¶
- func CheckFileExisted(filePath string, timeout time.Duration) error
- func CheckMultiFileExisted(timeout, interval time.Duration, filePaths ...string) (string, error)
- func CopyDir(srcPath, desPath string) error
- func CopyFileByIoCopy(src, des string) (written int64, err error)
- func CopyFileByIoUtil(src, des string) (written int64, err error)
- func CopyFileByOs(src, des string, bufSize int) (written int64, err error)
- func CreateFile(Path string) (*os.File, error)
- func FileIsExisted(filename string) bool
- func GetFileModTime(filename string) (time.Time, error)
- func GetFileSize(filename string) (int64, error)
- func IsDir(name string) bool
- func ListDir(dir, suffix string) (files []string, err error)
- func MakeDir(dir string) error
- func ReadFile(filename string) ([]byte, error)
- func RemoveAll(dir string) error
- func RemoveFile(filename string) error
- func RenameFile(oldPath, newPath string) error
- func ReplacePathExt(path, newExt string) string
- func WalkDir(dir, suffix string) (files []string, err error)
- func WriteDataToFile(filePath string, data interface{}) error
- func ZipCompress(dest string, src ...string) error
- func ZipDeCompress(zipFile, dest string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFileExisted ¶
CheckFileExisted 检测单个文件是否存在
func CheckMultiFileExisted ¶
CheckMultiFileExisted 检查多个文件是否存在且修改时间大于interval
func CopyFileByIoCopy ¶
CopyFileByIoCopy 使用io.Copy文件, 复制文件过程中一定要注意将原始文件的权限也要复制过去,否则可能会导致可执行文件不能执行等问题
func CopyFileByIoUtil ¶
CopyFileByIoUtil 使用ioutil.WriteFile()和ioutil.ReadFile() 复制文件
func CopyFileByOs ¶
CopyFileByOs 使用os.Read()和os.Write()复制文件
func GetFileModTime ¶
GetFileModTime 获取文件修改时间
func ListDir ¶
ListDir 遍历指定文件夹中的所有文件(不进入下一级子目录) 获取指定路径下的所有文件及文件夹,只搜索当前路径,不进入下一级目录,可匹配后缀过滤(suffix为空则不过滤)
func WriteDataToFile ¶
WriteDataToFile 写数据到文件
func ZipCompress ¶
ZipCompress dest 为zip目录, src, otherSrc...为压缩文件或文件夹
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.