Documentation ¶
Index ¶
- Constants
- func Copy(src, dest string) error
- func CopyDir(srcPath, destPath string, filters ...func(filePath string) bool) error
- func CopyDir1(srcPath string, destPath string) error
- func CopyFile(src, dest string) (w int64, err error)
- func DirExistOrCreate(path string, is_create bool) (bool, error)
- func FileCTime(file string) (time.Time, error)
- func FileCTimeInt64(file string) (int64, error)
- func FileCTimeString(file string) (string, error)
- func FileMTime(file string) (time.Time, error)
- func FileMTimeInt64(file string) (int64, error)
- func FileMTimeString(file string) (string, error)
- func FileSize(file string) (int64, error)
- func FileSizeHumane(s uint64) string
- func FileSizeString(file string) string
- func GetAllSubDirs(rootPath string) ([]string, error)
- func GetFileInfo(file_path string) (_full_name, _suffix, _file_name string)
- func GetFileListBySuffix(dirPath, suffix string) ([]string, error)
- func GetGopaths() []string
- func GetHomeDir() (home string, _err error)
- func GetMP4Duration(reader io.ReaderAt) (lengthOfTime uint32, err error)
- func GetSrcpath(importPath string) (_appPath string, _err error)
- func IsDir(fileAddr string) bool
- func IsExist(path string) bool
- func IsFile(filePath string) bool
- func LgetAllSubDirs(rootPath string) ([]string, error)
- func LstatDir(rootPath string, includeDir ...bool) ([]string, error)
- func SecondToTime(sec int64) time.Time
- func StatDir(rootPath string, includeDir ...bool) ([]string, error)
- func WalkDir(dir string, suffix []string) (_files []string, _err error)
- func WriteFile(filename string, data []byte) error
- type BoxHeader
Constants ¶
const ( Byte = 1 KByte = Byte * 1024 MByte = KByte * 1024 GByte = MByte * 1024 TByte = GByte * 1024 PByte = TByte * 1024 EByte = PByte * 1024 )
Storage unit constants.
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶
CopyDir copy files recursively from source to target directory.
The filter accepts a function that process the path info. and should return true for need to filter.
It returns error when error occurs in underlying functions.
func CopyDir1 ¶
*
- 拷贝文件夹,同时拷贝文件夹中的文件
- @param srcPath 需要拷贝的文件夹路径: D:/test
- @param destPath 拷贝到的位置: D:/backup/
func DirExistOrCreate ¶
检测文件夹路径时候存在
func FileSizeHumane ¶
FileSizeHumane calculates the file size and generate user-friendly string.
func GetAllSubDirs ¶
GetAllSubDirs returns all subdirectories of given root path. Slice does not include given path itself.
func GetFileInfo ¶
获取文件名,后缀信息 req: "D:/software/Typora/bin/typora.exe" resp: typora.exe , .exe , typora
func GetFileListBySuffix ¶
GetFileListBySuffix returns an ordered list of file paths. It recognize if given path is a file, and don't do recursive find.
func GetGopaths ¶
func GetGopaths() []string
func GetHomeDir ¶
func GetMP4Duration ¶
GetMP4Duration 获取视频时长,以秒计
func GetSrcpath ¶
func LgetAllSubDirs ¶
LgetAllSubDirs returns all subdirectories of given root path, including following symbolic links, if any. Slice does not include given path itself.
func LstatDir ¶
LstatDir gathers information of given directory by depth-first. It returns slice of file list, follows symbolic links and includes subdirectories if enabled; it returns error and nil slice when error occurs in underlying functions, or given path is not a directory or does not exist.
Slice does not include given path itself. If subdirectories is enabled, they will have suffix '/'.
func StatDir ¶
StatDir gathers information of given directory by depth-first. It returns slice of file list and includes subdirectories if enabled; it returns error and nil slice when error occurs in underlying functions, or given path is not a directory or does not exist.
Slice does not include given path itself. If subdirectories is enabled, they will have suffix '/'.