file

package
v0.0.0-...-796898b Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package file 文件操作工具

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

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

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

func CreateAndWrite

func CreateAndWrite(filePath string, data []byte, force bool) error

CreateAndWrite 创建并写入内容到文件中

func DeCompressTar

func DeCompressTar(tarFile, dest string) error

* @tarFile:压缩文件路径 @dest:解压文件夹

func DeCompressZip

func DeCompressZip(zipFile, dest string) error

解压

func PathExists

func PathExists(path string) (bool, error)

PathExists 判断路径是否存在

func ReadFileByLine

func ReadFileByLine(filePath string) ([]string, error)

ReadFileByLine 从文件中逐行读取并返回字符串数组

func ReadFileFirstLine

func ReadFileFirstLine(filePath string) (string, error)

ReadFileFirstLine 从文件中逐行读取并返回字符串数组

Types

This section is empty.

Jump to

Keyboard shortcuts

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