Documentation
¶
Index ¶
- func Append(fileName string, content string)
- func AppendHead(fileName string, content string)
- func Clear(dst string) error
- func ClearDir(dst string) error
- func Copy(src, dst string) error
- func CopyDir(source string, dst string) error
- func CopyFile(src, dst string) (err error)
- func Create(fileName string) (*os.File, error)
- func CreateDir(dirName string) error
- func Each(dir string, fn func(fileName string, fi os.FileInfo)) error
- func EachFiles(dir string, fn func(fileName string, fi os.FileInfo)) error
- func EachFilesToAppendHead(dir string, content string, options map[string]any) error
- func EachFilesToRemove(dir string, fn func(fileName string, fi os.FileInfo) bool) error
- func EachFilesToRename(dir string, fn func(oldName string) string) (err error)
- func GetFiles(dir, suffix string) (files []string, err error)
- func GetFirstFiles(dir string) ([]fs.DirEntry, error)
- func IsExist(path string) bool
- func Load(url string, fileName string) error
- func MustCreate(fileName string) *os.File
- func MustRead(fileName string) []byte
- func OpenOrCreate(fileName string, flag int, perm os.FileMode) (*os.File, error)
- func ReadFile(fileName string) ([]byte, error)
- func Remove(fileName string) error
- func Save(fileName string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EachFilesToAppendHead ¶
EachFilesToAppendHead 遍历目录下的所有文件,添加文件头
func EachFilesToRemove ¶
EachFilesToRemove 遍历文件夹,当回调函数返回true的时候删除文件 注意,当一个目录下所有文件都被删除,这个目录本身也不会被删除
func EachFilesToRename ¶
批量重命名指定目录及所有子目录下的所有文件。(不包含目录)
func OpenOrCreate ¶
OpenOrCreate 创建不存在的文件
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.