Documentation
¶
Index ¶
- Constants
- func FileExist(filePath string) bool
- type FileWriter
- func (f *FileWriter) Close()
- func (f *FileWriter) Info() error
- func (f *FileWriter) ReadString(length int) (string, error)
- func (f *FileWriter) Rename(newName string) error
- func (f *FileWriter) Seek(offset int64, whence int) error
- func (f *FileWriter) WriteByte(b []byte) error
- func (f *FileWriter) WriteString(s string) error
Constants ¶
View Source
const ( Read = 4 Write = 2 Exec = 1 )
View Source
const ( FileBegin = 0 FileNow = 1 FileEnd = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileWriter ¶
func NewFileWriter ¶
func NewFileWriter(filePath string, isAppend bool) (*FileWriter, error)
Write & Read 0644 is means -rw-r--r-- if you want to create a dir then use err := os.Mkdir("../src/p", os.ModePerm) where os.ModePerm means -rwxrwxrwx
func (*FileWriter) Close ¶
func (f *FileWriter) Close()
func (*FileWriter) ReadString ¶
func (f *FileWriter) ReadString(length int) (string, error)
func (*FileWriter) Rename ¶
func (f *FileWriter) Rename(newName string) error
rename the file and still to open it
func (*FileWriter) Seek ¶
func (f *FileWriter) Seek(offset int64, whence int) error
seek only effect read and don`t not effect write but after write the seek will change
func (*FileWriter) WriteByte ¶
func (f *FileWriter) WriteByte(b []byte) error
func (*FileWriter) WriteString ¶
func (f *FileWriter) WriteString(s string) error
Click to show internal directories.
Click to hide internal directories.