Documentation ¶
Index ¶
- Constants
- func Append(fname string, fn FileOpFunc) error
- func Copy(dst, src string) error
- func CopyDir(dst, src string) error
- func Create(fname string, fn FileOpFunc) error
- func Filter(src string, filter io2.LineFilterFunc) error
- func FilterTo(dst, src string, trunc bool, filter io2.LineFilterFunc) error
- func FirstLine(src string) (line string, err error)
- func IsDir(fname string) bool
- func IsDirOrNotExist(dir string) bool
- func IsExist(fname string) bool
- func IsFile(fname string) bool
- func IsFileOrNotExist(fname string) bool
- func IsModifiedAfter(fname string, fn func()) bool
- func IsSymlink(fname string) bool
- func Open(fname string, flags int, fn FileOpFunc) error
- func OpenOrCreate(fname string, trunc bool, fn FileOpFunc) error
- func Overwrite(src string, content string) error
- func Read(fname string, fn FileOpFunc) error
- func ReadWrite(fname string, fn FileOpFunc) error
- func Trunc(fname string, fn FileOpFunc) error
- func TruncSeek(fd *os.File)
- func Write(fname string, fn FileOpFunc) error
- func WriteFlag(trunc bool) int
- type FileOpFunc
Constants ¶
View Source
const ( FilePerm = 0644 DirPerm = 0755 )
View Source
const ErrDestIsFile = errors.Err("destnation is a file")
Variables ¶
This section is empty.
Functions ¶
func Append ¶
func Append(fname string, fn FileOpFunc) error
func Create ¶
func Create(fname string, fn FileOpFunc) error
func Filter ¶
func Filter(src string, filter io2.LineFilterFunc) error
Filter file content with given filter, file is in ReadOnly mode
func FilterTo ¶
func FilterTo(dst, src string, trunc bool, filter io2.LineFilterFunc) error
FilterTo filter file content with given filter, then write result to dest file
func IsDirOrNotExist ¶
IsDirOrNotExist check whether given is a directory or not exist
func IsFileOrNotExist ¶
IsFileOrNotExist check whether given name is a file or not exist
func IsModifiedAfter ¶
IsModifiedAfter check whether or not file is modified by the function
func OpenOrCreate ¶
func OpenOrCreate(fname string, trunc bool, fn FileOpFunc) error
func Read ¶
func Read(fname string, fn FileOpFunc) error
func ReadWrite ¶
func ReadWrite(fname string, fn FileOpFunc) error
func Trunc ¶
func Trunc(fname string, fn FileOpFunc) error
func Write ¶
func Write(fname string, fn FileOpFunc) error
Types ¶
type FileOpFunc ¶
FileOpFunc accept a file descriptor, return an error or nil
Click to show internal directories.
Click to hide internal directories.