Documentation ¶
Index ¶
- Constants
- func Sort(files []*File, sortType ...SortType)
- type Appender
- func (this *Appender) Append(b []byte) (n int, err error)
- func (this *Appender) AppendString(s string) (n int, err error)
- func (this *Appender) Close() error
- func (this *Appender) Lock()
- func (this *Appender) Sync() error
- func (this *Appender) Truncate(size ...int64) error
- func (this *Appender) Unlock()
- type File
- func (this *File) AbsPath() (string, error)
- func (this *File) Append(data []byte) error
- func (this *File) AppendString(data string) error
- func (this *File) Appender() (*Appender, error)
- func (this *File) Child(filename string) *File
- func (this *File) Chmod(mode os.FileMode) error
- func (this *File) CopyTo(targetPath string) error
- func (this *File) Create() error
- func (this *File) Delete() error
- func (this *File) DeleteAll() error
- func (this *File) DeleteIfExists() error
- func (this *File) Exists() bool
- func (this *File) Ext() string
- func (this *File) Glob(pattern string) []*File
- func (this *File) IsDir() bool
- func (this *File) IsFile() bool
- func (this *File) LastModified() (time.Time, error)
- func (this *File) List() []*File
- func (this *File) Md5() (string, error)
- func (this *File) Mkdir(perm ...os.FileMode) error
- func (this *File) MkdirAll(perm ...os.FileMode) error
- func (this *File) Mode() (os.FileMode, error)
- func (this *File) Name() string
- func (this *File) Parent() *File
- func (this *File) Path() string
- func (this *File) Range(iterator func(file *File))
- func (this *File) ReadAll() ([]byte, error)
- func (this *File) ReadAllString() (string, error)
- func (this *File) Reader() (*Reader, error)
- func (this *File) Size() (int64, error)
- func (this *File) Stat() (*Stat, error)
- func (this *File) Touch() error
- func (this *File) Write(data []byte) error
- func (this *File) WriteFormat(format string, args ...interface{}) error
- func (this *File) WriteString(data string) error
- func (this *File) Writer() (*Writer, error)
- type Reader
- func (this *Reader) Close() error
- func (this *Reader) Length() (length int64, err error)
- func (this *Reader) Read(size int64) []byte
- func (this *Reader) ReadAll() []byte
- func (this *Reader) ReadByte() []byte
- func (this *Reader) ReadJSON(ptr interface{}) error
- func (this *Reader) ReadJSONMap() (maps.Map, error)
- func (this *Reader) ReadLine() []byte
- func (this *Reader) ReadYAML(ptr interface{}) error
- func (this *Reader) ReadYAMLMap() (maps.Map, error)
- func (this *Reader) Reset() error
- func (this *Reader) Seek(offset int64, whence ...Whence) (ret int64, err error)
- type SortType
- type Stat
- type Whence
- type Writer
- func (this *Writer) Close() error
- func (this *Writer) Lock()
- func (this *Writer) Seek(offset int64, whence ...Whence) (ret int64, err error)
- func (this *Writer) Sync() error
- func (this *Writer) Truncate(size ...int64) error
- func (this *Writer) Unlock()
- func (this *Writer) Write(b []byte) (n int64, err error)
- func (this *Writer) WriteIOReader(reader io.Reader) (n int64, err error)
- func (this *Writer) WriteJSON(value interface{}, pretty ...bool) (n int64, err error)
- func (this *Writer) WriteString(s string) (n int64, err error)
- func (this *Writer) WriteYAML(value interface{}) (n int64, err error)
Constants ¶
View Source
const ( WhenceStart = 0 // 文件开始处 WhenceCurrent = 1 // 文件当前位置 WhenceEnd = 2 // 文件末尾处 )
View Source
const ( SortTypeModifiedTime = SortType(1) // 按最后修改时间 SortTypeModifiedTimeReverse = SortType(2) // 按最后修改时间倒排序 SortTypeName = SortType(3) // 按名称 SortTypeNameReverse = SortType(4) // 按名称倒排序 SortTypeSize = SortType(5) // 按文件尺寸 SortTypeSizeReverse = SortType(6) // 按文件尺寸倒排序 SortTypeKind = SortType(7) // 按文件类型 SortTypeKindReverse = SortType(8) // 按文件类型倒排序 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
func NewAppender ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
文件对象定义
func NewTmpFile ¶
func (*File) DeleteIfExists ¶
判断文件或目录是否存在,然后删除文件或目录,如果目录不为空则会失败
func (*File) ReadAllString ¶
ReadAllString 读取文件内容并返回字符串形式
func (*File) WriteFormat ¶
写入格式化的字符串数据
Source Files ¶
Click to show internal directories.
Click to hide internal directories.