file

package module
v0.0.0-...-126f1fd Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendTo

func AppendTo(fileName, content string) error

AppendTo append to file

func Copy

func Copy(src, dst string) error

Copy copies file from source to target path.

func CopyFile

func CopyFile(src, dst string) (int64, error)

CopyFile copies file from source to target path.

func Empty

func Empty(fileName string, args ...int64)

Empty empty the file

func Exist

func Exist(fileName string) bool

Exist checks whether a file or directory exists. It returns false when the file or directory does not exist.

func IoSha

func IoSha(fileIO *os.File, args ...string) (string, error)

IoSha file sha

func Is

func Is(filePath string) bool

Is returns true if path is a file, or returns false when it's a directory or not exist.

func IsDir

func IsDir(filePath string) bool

IsDir returns true if path is a directory, or returns false when it's a file or not exist.

func List

func List(dirPth, suffix string) (files []string, err error)

List list file

func ListDir

func ListDir(dirPth, suffix string) (files []string, err error)

ListDir list dir

func MTime

func MTime(file string) (int64, error)

MTime returns file modified time and possible error.

func Mode

func Mode(filePath string) os.FileMode

Mode returns file mode if file is a exist.

func OpenCopy

func OpenCopy(srcName, dstName string) (int64, error)

OpenCopy open and copy file

func PathExists

func PathExists(path string) (bool, error)

PathExists path is exist

func Read

func Read(fileName string) (string, error)

Read read file and return string

func ReadFromIO

func ReadFromIO(fio io.Reader) (string, error)

ReadFromIO read io.Reader return string and error

func ReadIo

func ReadIo(fileName string) (io.Reader, error)

ReadIo read file return io.Reader

func Search(fileName string, paths ...string) (fullpath string, err error)

Search Search a file in paths.

func Sha

func Sha(filePath string, args ...string) (sha string, err error)

Sha open file return sha

func Size

func Size(file string) (int64, error)

Size returns file size in bytes and possible error.

func Walk

func Walk(dirPth, suffix string) (files []string, err error)

Walk walk file

func WalkDir

func WalkDir(dirPth, suffix string) (files []string, err error)

WalkDir walk dir

func Write

func Write(fileName, writeStr string) error

Write writes data to a file named by filename. If the file does not exist, WriteFile creates it and its upper level paths.

func WriteFile

func WriteFile(fileName string, data []byte) error

WriteFile writes data to a file named by filename. If the file does not exist, WriteFile creates it and its upper level paths.

func WriteIo

func WriteIo(fileName string, fio io.Reader) error

WriteIo wite file with io.Reader

Types

This section is empty.

Jump to

Keyboard shortcuts

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