afis

package
v0.0.0-...-884beae Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: GPL-3.0 Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileOwner

func CheckFileOwner(file, uname string) bool

检查文件的属主与给定的user是否匹配

func ChmodDirR

func ChmodDirR(dname string, mode os.FileMode) error

递归更改整个目录权限

func ChownDirR

func ChownDirR(dname, uname string) error

递归更改整个目录属主

func ChownFile

func ChownFile(fname, uname string) error

更改文件属主

func Contains

func Contains(sl []interface{}, v interface{}) bool

func ContainsInt

func ContainsInt(sl []int, v int) bool

func ContainsInt64

func ContainsInt64(sl []int64, v int64) bool

func ContainsString

func ContainsString(sl []string, v string) bool

func CopyDir

func CopyDir(src, dst string) error

复制整个目录

func CopyFile

func CopyFile(src, dst string) error

复制单个文件

func DownloadCode

func DownloadCode(dst, src string) error

从http链接下载代码 http://lp:0124@127.0.0.1/hfp/tst.tar.gz

func GetHostName

func GetHostName() (string, error)

func GetLocalIP

func GetLocalIP() ([]string, error)

func GetMd5String

func GetMd5String(str string) string

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsExecutable

func IsExecutable(path string) bool

check file is executable

func IsExists

func IsExists(path string) bool

判断所给路径文件/文件夹是否存在

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

func IsUser

func IsUser(uname string) bool

判断用户是否存在

func ReadUUIDFromFile

func ReadUUIDFromFile(uuidfile string) (string, error)

func RemoveContents

func RemoveContents(dir string) error

删除目录中的内容

func Unzip

func Unzip(archive, target string) error

解压zip

func WalkOnce

func WalkOnce(root string, walkFn filepath.WalkFunc) error

func WriteUUID2File

func WriteUUID2File(uuidfile string) error

func Zipit

func Zipit(source, target, filter string) error

压缩为zip格式 source为要压缩的文件或文件夹, 绝对路径和相对路径都可以 target是目标文件 filter是过滤正则(Golang 的 包 path.Match)

Types

This section is empty.

Jump to

Keyboard shortcuts

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