Documentation
¶
Index ¶
- type File
- func (f *File) Clean()
- func (f *File) GetChildren() ([]*File, error)
- func (f *File) GetName() string
- func (f *File) GetPath() string
- func (f *File) GetPrefix() string
- func (f *File) GetSuffix() string
- func (f *File) IsDir() bool
- func (f *File) MkdirAll(name string) (*File, error)
- func (f *File) Move(path string) error
- func (f *File) Paste(newpath string) error
- func (f *File) Read() ([]byte, error)
- func (f *File) Remove() error
- func (f *File) Rename(name string) error
- func (f *File) Replace(newFile *File)
- func (f *File) Size() int64
- type IFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
type IFile ¶ added in v1.0.5
type IFile interface {
Read() ([]byte, error) // 基于读取当前文件数据并返回一个[]byte
GetPath() string // 获取当前文件路径
GetName() string // 获取当前文件名
GetPrefix() string // 获取当前文件名前缀 例: test.abc 返回 test
GetSuffix() string // 获取当前文件后缀 例: test.abc 返回 .abc
Size() int64 // 获取当前文件大小
IsDir() bool // 获取当前文件是否是文件夹
MkdirAll(name string) (*File, error) // 基于当前目录创建文件夹
Remove() error // 删除当前文件
Rename(name string) error // 文件重命名
Move(path string) error // 文件移动
Paste(newpath string) error // 文件粘贴 将当前文件粘贴到指定目录
GetChildren() ([]*File, error) // 获取当前文件目录下文件数据
Clean() // 情况当前结构数据
Replace(newFile *File) // 替换 将当前文件数据替换
// contains filtered or unexported methods
}
IFile 文件工具接口
Click to show internal directories.
Click to hide internal directories.