Documentation ¶
Index ¶
- Constants
- Variables
- func Append(fpath string, data []byte) (err error)
- func AppendText(fpath, text string) (err error)
- func Author() string
- func Chmod(fpath string, mode os.FileMode) error
- func ChmodAll(root string, mode os.FileMode) error
- func Chown(fpath string, uid, gid int) error
- func ChownAll(root string, uid, gid int) error
- func Copy(src, dst string) error
- func Exists(fpath string) bool
- func IsDir(fpath string) bool
- func IsFile(fpath string) bool
- func IsSymlink(fpath string) bool
- func Lexists(fpath string) bool
- func License() string
- func MTime(fpath string) (int64, error)
- func New(fpath string) (*os.File, error)
- func NewFile(fpath string, isAppend bool) (*os.File, error)
- func Read(fpath string) ([]byte, error)
- func ReadFirstLine(fpath string) (line string, err error)
- func ReadLastLine(fpath string) (line string, err error)
- func ReadLines(fpath string, n int) (lines []string, err error)
- func ReadText(fpath string) (string, error)
- func Size(fpath string) (int64, error)
- func Version() string
- func Write(fpath string, data []byte) (err error)
- func WriteText(fpath, text string) (err error)
- type LsFile
Constants ¶
View Source
const ( // TypeAll list dir and file TypeAll int = iota // TypeDir list only dir TypeDir // TypeFile list only file TypeFile )
Variables ¶
View Source
var ( // ErrNotExists file is exists error ErrNotExists = errors.New("xfile: file is not exists") // ErrHasExists file is exists error ErrHasExists = errors.New("xfile: the file is exists") )
Functions ¶
func AppendText ¶ added in v0.25.5
AppendText appends string data to file
func ReadFirstLine ¶
ReadFirstLine returns first NOT empty line
func ReadLastLine ¶ added in v0.25.6
ReadLastLine returns last NOT empty line
Types ¶
Click to show internal directories.
Click to hide internal directories.