Documentation ¶
Index ¶
- Constants
- func CloneDir(fromDir, toDir string, replaceSame bool, filter func(filePath string) bool) (targetFiles []string, e error)
- func CloneFile(from, to string) (e error)
- func DeletePath(path string) int
- func EnsureDir(dir string) error
- func GetDirChildren(dirPath string, flag int) []string
- func GetExecFileDir() (dir string, err error)
- func IsDirExists(path string) bool
- func IsFileExists(path string) bool
- func ReadFile(path string, offset, leng int64) (content []byte, err error)
- func WriteFile(path string, data []byte, createIfNoFile bool, overrideOrAppend bool) error
- type FileFilter
- type FileInfo
- type FileInfoFilter
- type FileTree
- type FolderStruct
Constants ¶
View Source
const ( All int = 0 File int = 1 Dir int = 2 )
Variables ¶
This section is empty.
Functions ¶
func CloneDir ¶
func CloneDir(fromDir, toDir string, replaceSame bool, filter func(filePath string) bool) (targetFiles []string, e error)
将from文件夹下面的文件,全部clone到toDir,例如传入./a/, ./b/, 则 ./a/c.txt 会clone到 ./b/c.txt
func DeletePath ¶
func GetDirChildren ¶
0,all kind 1.only file 2.only dir
func GetExecFileDir ¶
func IsDirExists ¶
func IsFileExists ¶
Types ¶
type FileFilter ¶
type FileInfoFilter ¶
type FileTree ¶
func GetDirChildrenWithFilter ¶
func GetDirChildrenWithFilter(dirPath string, maxLevel int, filter FileFilter) FileTree
type FolderStruct ¶
type FolderStruct struct { Name string `json:"name,omitempty"` IsDir bool `json:"isDir,omitempty"` Size int64 `json:"size,omitempty"` ModifyAt int64 `json:"modifyAt,omitempty"` Children []FolderStruct `json:"children,omitempty"` }
func GetFolderStruct ¶
func GetFolderStruct(dirPath string, maxLevel int) FolderStruct
Click to show internal directories.
Click to hide internal directories.