file

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNotExist

func CheckNotExist(src string) bool

CheckNotExist check if the file exists

func CheckPermission

func CheckPermission(src string) bool

CheckPermission check if the file has permission

func CopyDir added in v0.2.9

func CopyDir(src string, dst string) error

Dir copies a whole directory recursively

func CopyFile added in v0.2.9

func CopyFile(src, dst string) error

File copies a single file from src to dst

func CreateFile

func CreateFile(path string) error

func Exists

func Exists(path string) bool

判断所给路径文件/文件夹是否存在

func GetExt

func GetExt(fileName string) string

GetExt get the file ext

func GetSize

func GetSize(f multipart.File) (int, error)

GetSize get the file size

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

func IsNotExistCreateFile

func IsNotExistCreateFile(src string) error

IsNotExistMkDir create a directory if it does not exist

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

IsNotExistMkDir create a directory if it does not exist

func MkDir

func MkDir(src string) error

MkDir create a directory

func MustOpen

func MustOpen(fileName, filePath string) (*os.File, error)

MustOpen maximize trying to open the file

func Open

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

Open a file according to a specific mode

func RMDir

func RMDir(src string) error

RMDir remove a directory

func ReadFullFile

func ReadFullFile(path string) []byte

Types

type ReadLineFromEnd

type ReadLineFromEnd struct {
	// contains filtered or unexported fields
}

ReadLineFromEnd --

func NewReadLineFromEnd

func NewReadLineFromEnd(name string) (rd *ReadLineFromEnd, err error)

NewReadLineFromEnd --

func (*ReadLineFromEnd) Close

func (c *ReadLineFromEnd) Close() (err error)

Close --

func (*ReadLineFromEnd) ReadLine

func (c *ReadLineFromEnd) ReadLine() (line []byte, err error)

ReadLine 结尾包含'\n'

Jump to

Keyboard shortcuts

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