file

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileExist

func CheckFileExist(fileName string) bool

CheckFileExist Check file exists or not, if file exist, return true, else return false.

func CreateFile

func CreateFile(fileName string)

CreateFile Create a file with a given fileName.

func GetFileInfo

func GetFileInfo(fileName string) (os.FileInfo, error)

GetFileInfo Get file infos like Name, Size, Mode...

func ReadFile

func ReadFile(fileName string) string

ReadFile Read all file content and return.

func ReadFileByChunks

func ReadFileByChunks(fileName string, size int) string

ReadFileByChunks Read file with given size.

func ReadFileByLine

func ReadFileByLine(fileName string, delim byte) string

ReadFileByLine Read file line by line.

func RemoveFile

func RemoveFile(fileName string)

RemoveFile Remove file with given fileName.

func WriteFile

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

WriteFile Write file with given fileName and data, return error if write failed.

func WriteFileWithAppend

func WriteFileWithAppend(fileName string, data string) error

WriteFileWithAppend Write data to file with a given fileName If file exists, append data If not, create a new file and write data to the file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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