Documentation ¶
Index ¶
- type FileInfo
- type FileUtil
- func (FileUtil) CopyDir(sourceDirPath, targetDirPath string) (bool, error)
- func (fu FileUtil) CreateFile(filePath string) (bool, error)
- func (fu FileUtil) CreateFileDir(filePath string) (bool, error)
- func (fu FileUtil) CurrentDir() string
- func (fu FileUtil) Del(path string) (bool, error)
- func (fu FileUtil) DelFiles(dir string, delDir bool) error
- func (fu FileUtil) Exists(path string) (bool, error)
- func (fu FileUtil) GetAllFiles(dirPth string) (files []string, err error)
- func (fu FileUtil) GetFilesAndDirs(dirPth string) (files []string, dirs []string, err error)
- func (fu FileUtil) GetFilesTree(rootName string, delRoot bool) *emity.MsgEmity
- func (fu FileUtil) IsDir(path string) bool
- func (fu FileUtil) IsExist(path string) bool
- func (fu FileUtil) IsFile(path string) bool
- func (fu FileUtil) Read(path string) *emity.MsgEmity
- func (fu FileUtil) ReadFromFile(path string) *emity.MsgEmity
- func (fu FileUtil) Save(text string, path string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct { GsName string `json:"sName"` //名称 GsPath string `json:"sPath"` //路径 GiDir int `json:"iDir"` //是否目录 GiSize int64 `json:"iSize"` //大小 GdTime string `json:"dTime"` //修改时间 Gchildren []*FileInfo `json:"children"` //子文件 }
*
- 文件信息信息
- @author HuangXinBian
type FileUtil ¶
type FileUtil struct{}
func (FileUtil) CreateFile ¶
调用os.MkdirAll递归创建文件夹
func (FileUtil) CreateFileDir ¶
*
- 创建文件所在文件夹
- 注意:必须是文件,否则只能创建出上级路径
- @param filePath 文件路径
- @return bool:是否成功(如果路径已经存在则不会创建,但返回true); error:错误信息
func (FileUtil) Exists ¶
*
- 判断文件夹是否存在
- @param filePath 文件路径
- @return bool, error:是否存在(存在返回true); error:错误信息
func (FileUtil) GetAllFiles ¶
获取指定目录下的所有文件,包含子目录下的文件
func (FileUtil) GetFilesAndDirs ¶
获取指定目录下的所有文件和目录
Click to show internal directories.
Click to hide internal directories.