file

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDirs

func CreateDirs(path string) error

创建文件夹

func IsExist

func IsExist(path string) bool

判断文件或文件夹是否存在

func ReadFileWithIoutil added in v0.0.3

func ReadFileWithIoutil(fullName string, handleLine func(int, string)) error

func ReadLineWithBufio added in v0.0.3

func ReadLineWithBufio(fullName string, handleLine func(int, string)) error

func ReadLineWithFile added in v0.0.3

func ReadLineWithFile(fullName string, handleLine func(int, string)) error

func ReadLineWithOs added in v0.0.3

func ReadLineWithOs(fullName string, handleLine func(int, string)) error

func WriteFileBufio added in v0.0.3

func WriteFileBufio(fullName string, flag int, body []byte) error

func WriteFileWithIoutil added in v0.0.3

func WriteFileWithIoutil(fullName string, body []byte) error

func WriteFileWithOS added in v0.0.3

func WriteFileWithOS(fullName string, body []byte) error

Types

type Fs

type Fs interface {
	Create(name string) (*os.File, error)
	Mkdir(name string, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
	Open(name string) (*os.File, error)
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	Remove(name string) error
	RemoveAll(path string) error
	Rename(oldname, newname string) error
	Stat(name string) (os.FileInfo, error)
	Name() string
	Chmod(name string, mode os.FileMode) error
	Chtimes(name string, atime time.Time, mtime time.Time) error
}

func NewOsFs

func NewOsFs() Fs

type OsFs

type OsFs struct {
}

func (OsFs) Chmod

func (OsFs) Chmod(name string, mode os.FileMode) error

func (OsFs) Chtimes

func (OsFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (OsFs) Create

func (OsFs) Create(name string) (*os.File, error)

func (OsFs) LstatIfPossible

func (OsFs) LstatIfPossible(name string) (os.FileInfo, bool, error)

func (OsFs) Mkdir

func (OsFs) Mkdir(name string, perm os.FileMode) error

func (OsFs) MkdirAll

func (OsFs) MkdirAll(path string, perm os.FileMode) error

func (OsFs) Name

func (OsFs) Name() string

func (OsFs) Open

func (OsFs) Open(name string) (*os.File, error)

func (OsFs) OpenFile

func (OsFs) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

func (OsFs) Remove

func (OsFs) Remove(name string) error

func (OsFs) RemoveAll

func (OsFs) RemoveAll(path string) error

func (OsFs) Rename

func (OsFs) Rename(oldname, newname string) error

func (OsFs) Stat

func (OsFs) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL