file

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(filePath string) error

Create 创建文件

func GetExt

func GetExt(filePath string) string

GetExt 获取文件扩展名

func GetName

func GetName(filePath string) string

GetName 获取文件名

func GetNameWithoutExt

func GetNameWithoutExt(filePath string) string

GetNameWithoutExt 获取不带扩展名的文件名

func IsDir

func IsDir(path string) bool

IsDir 判断一个路径是否为目录

func IsExsit

func IsExsit(path string) bool

IsExsit 文件或目录是否存在

func IsFile

func IsFile(path string) bool

IsFile 判断一个路径是否为文件

func ReadAll

func ReadAll(filePath string) ([]byte, error)

ReadAll 读取文件所有内容

func SplitDirAndFileName

func SplitDirAndFileName(filePath string) (dir, file string)

SplitDirAndFileName 将目录与文件名分开

func Unzip added in v1.0.5

func Unzip(zipFile string, toPath string) error

Unzip zip解压缩

zipFile zip文件路径 eg: /opt/test.zip

toPath 解压到目录 eg: /opt/test

func Zip added in v1.0.5

func Zip(filePath string, zipFileName string) error

Zip zip压缩,生成的压缩文件存在于压缩目录中

filePath 被压缩文件目录 eg: /opt/test

zipFileName zip文件名 eg: test

Types

This section is empty.

Jump to

Keyboard shortcuts

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