Documentation ¶
Index ¶
- type FileSystemUtils
- func (fsu *FileSystemUtils) CreateDirIfNotExist(relativePath string) error
- func (fsu *FileSystemUtils) Delete(path string) error
- func (fsu *FileSystemUtils) GetAllFilesByExt(dir string, ext string) ([]string, error)
- func (fsu *FileSystemUtils) GetCurExeDir() string
- func (fsu *FileSystemUtils) GetFileCreationTime(filePath string) (string, time.Time, error)
- func (fsu *FileSystemUtils) GetFileMd5(filePath string) (string, error)
- func (fsu *FileSystemUtils) GetFileMd5Stream(filePath string) (string, error)
- func (fsu *FileSystemUtils) GetFileNameMd5(filename string) (string, error)
- func (fsu *FileSystemUtils) IsDirAndHasFiles(dirPath string) (bool, bool, error)
- func (fsu *FileSystemUtils) IsFile(path string) (bool, error)
- func (fsu *FileSystemUtils) StartsWithDot(fileName string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSystemUtils ¶
type FileSystemUtils struct{}
FileSystemUtils 定义文件系统工具类
func NewFileSysUtils ¶
func NewFileSysUtils() *FileSystemUtils
func (*FileSystemUtils) CreateDirIfNotExist ¶
func (fsu *FileSystemUtils) CreateDirIfNotExist(relativePath string) error
CreateDirIfNotExist 在当前执行文件所在目录下创建指定的目录,如果目录不存在
func (*FileSystemUtils) Delete ¶
func (fsu *FileSystemUtils) Delete(path string) error
Delete 删除指定路径的文件或目录
func (*FileSystemUtils) GetAllFilesByExt ¶
func (fsu *FileSystemUtils) GetAllFilesByExt(dir string, ext string) ([]string, error)
GetAllFilesByExt 根据文件扩展名获取所有文件
func (*FileSystemUtils) GetCurExeDir ¶
func (fsu *FileSystemUtils) GetCurExeDir() string
GetCurExeDir 获取当前执行文件所在目录
func (*FileSystemUtils) GetFileCreationTime ¶
GetFileCreationTime 获取文件创建时间
func (*FileSystemUtils) GetFileMd5 ¶
func (fsu *FileSystemUtils) GetFileMd5(filePath string) (string, error)
GetFileMd5 计算文件的 MD5 值
func (*FileSystemUtils) GetFileMd5Stream ¶
func (fsu *FileSystemUtils) GetFileMd5Stream(filePath string) (string, error)
GetFileMd5Stream 通过流的方式计算文件的 MD5 值
func (*FileSystemUtils) GetFileNameMd5 ¶
func (fsu *FileSystemUtils) GetFileNameMd5(filename string) (string, error)
GetFileNameMd5 计算文件名的 MD5 值
func (*FileSystemUtils) IsDirAndHasFiles ¶
func (fsu *FileSystemUtils) IsDirAndHasFiles(dirPath string) (bool, bool, error)
IsDirAndHasFiles 检查目录是否存在并且包含文件
func (*FileSystemUtils) IsFile ¶
func (fsu *FileSystemUtils) IsFile(path string) (bool, error)
IsFile 路径是否是个文件
func (*FileSystemUtils) StartsWithDot ¶
func (fsu *FileSystemUtils) StartsWithDot(fileName string) bool
StartsWithDot 检查文件名是否以 '.' 开头
Click to show internal directories.
Click to hide internal directories.