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
}
func (*File) GetChildren ¶
GetChilren based on the current folder get all the children files
func (*File) MkdirAll ¶
MkdirAll based on the current folder create a new folder if the name path is file then return error
func (*File) Remove ¶
Remove remove the current file remove the current file the file object will be reset
func (*File) Rename ¶
Rename based on the current file rename to a new file file rename to a new file
type IFile ¶
type IFile interface { Read() ([]byte, error) // based on reading current file data and return the file bytes GetPath() string // get the file path GetName() string // get the file name GetPrefix() string // get the file prefix name demo: test.abc return test GetSuffix() string // get the file suffix name demo: test.abc return .abc Size() int64 // get the file size IsDir() bool // the file is a folder MkdirAll(name string) (*File, error) // based on the current folder create a new folder Remove() error // remove the current file Rename(name string) error // based on the current file rename to a new file Move(path string) error // based on the current file move to a new file Paste(newpath string) error // based on the current file paste to a new file GetChildren() ([]*File, error) // based on the current folder get all the children files Clean() // clean the file Replace(newFile *File) // based on the current file replace to a new file // contains filtered or unexported methods }
IFile 文件工具接口
Click to show internal directories.
Click to hide internal directories.