file

package
v0.0.0-...-d57715f Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsolutePath

func AbsolutePath(value string) (string, error)

Returns the absolute path of a file

func BaseName

func BaseName(filename string) string

Returns the base name of a file

func DirExists

func DirExists(filename string) bool

returns true if a given directory exists

func DirName

func DirName(filename string) string

Returns the directory name of a file

func FileExists

func FileExists(name string) (bool, error)

FileExists reports whether the named file or directory exists.

func FileModTime

func FileModTime(filename string) int64

returns modify time of file

func GlobalTempDir

func GlobalTempDir() string

func SlurpAsBytes

func SlurpAsBytes(filename string) ([]byte, error)

reads a file and returns its contents as a byte slice

func TarCompress

func TarCompress(src string, buf io.Writer) error

func UntarDecompress

func UntarDecompress(src io.Reader, dst string) error

func Unzip

func Unzip(zipFile, dest string) error

解压

func WriteRegularFile

func WriteRegularFile(fileName, text, directory string) (string, error)

func WriteString

func WriteString(line string, filename string) error

append a string into an existing file

func WriteStrings

func WriteStrings(lines []string, filename string, termination string) error

Writes a string slice into a file The file is created

func Zip

func Zip(files []*os.File, dest string) error

压缩文件 files 文件数组,可以是不同dir下的文件或者文件夹 dest 压缩文件存放地址

Types

This section is empty.

Jump to

Keyboard shortcuts

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