Documentation ¶
Index ¶
- Constants
- type FileInfo
- type FileManager
- func (fm *FileManager) CleanFile(filePathName string) error
- func (fm *FileManager) CloseFile(filePathName string)
- func (fm *FileManager) GetFileInfo(filePathName string) *FileInfo
- func (fm *FileManager) OpenFile(filePathName string, args ...interface{}) (*FileInfo, error)
- func (fm *FileManager) Read(filePathName string, length int) ([]byte, error)
- func (fm *FileManager) Write(filePathName string, data []byte) (int, error)
Constants ¶
View Source
const FILE_CAPA_UNLIMIT int64 = 0
View Source
const FILE_LIFE_UNLIMIT int64 = 0
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct { Path string //路径名称 Name string //文件名称(文件名+类型:"007.txt") Type string //类型(".txt") Size file.SIZE //实际大小(单位:MB)(不准确) CreateTime time.Time //文件创建日期(不准确) WFd *os.File //写文件描述符 RFd *os.File //读文件描述符 // contains filtered or unexported fields }
文件信息
func (*FileInfo) CreateFile ¶
type FileManager ¶
type FileManager struct {
// contains filtered or unexported fields
}
func NewFileManager ¶
func NewFileManager(maxFileNum int) *FileManager
func (*FileManager) CleanFile ¶
func (fm *FileManager) CleanFile(filePathName string) error
func (*FileManager) CloseFile ¶
func (fm *FileManager) CloseFile(filePathName string)
func (*FileManager) GetFileInfo ¶
func (fm *FileManager) GetFileInfo(filePathName string) *FileInfo
func (*FileManager) OpenFile ¶
func (fm *FileManager) OpenFile(filePathName string, args ...interface{}) (*FileInfo, error)
打开文件 args:文件容量 dur:文件寿命 s
Click to show internal directories.
Click to hide internal directories.