util

package
v0.0.0-...-4b6b9ad Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Separator = string(os.PathSeparator)
)

Functions

func Command

func Command(commandName string, params []string) bool

func Compress

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

压缩 使用gzip压缩成tar.gz

func CopyDir

func CopyDir(srcPath string, destPath string) error

*

  • 拷贝文件夹,同时拷贝文件夹中的文件
  • @param srcPath 需要拷贝的文件夹路径: D:/test
  • @param destPath 拷贝到的位置: D:/backup/

func CopyExecDir

func CopyExecDir(srcPath string, destPath string) error

*

  • 拷贝文件夹,同时拷贝文件夹中的文件
  • @param srcPath 需要拷贝的文件夹路径: D:/test
  • @param destPath 拷贝到的位置: D:/backup/

func CopyExecFile

func CopyExecFile(file, desc string)

func CopyFile

func CopyFile(src, dest string) (w int64, err error)

生成目录并拷贝文件

func CreateFile

func CreateFile(name string) (*os.File, error)

func DeCompress

func DeCompress(tarFile, dest string) error

解压 tar.gz

func DownlaodFile

func DownlaodFile(filepath string, filename string) error

func ExecCommand

func ExecCommand(command string, args []string) (error, string, string)

func PathExists

func PathExists(path string) (bool, error)

func ReadAllIntoMemory

func ReadAllIntoMemory(filename string) (content []byte, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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