xfile

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndGetParentDir

func CheckAndGetParentDir(path string) string

CheckAndGetParentDir ...

func Exists

func Exists(fpath string) bool

Exists return weather file existed

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory ...

func GetCurrentPackage

func GetCurrentPackage() string

GetCurrentPackage ...

func IsDirectory

func IsDirectory(path string) (bool, error)

IsDirectory ...

func IsFileChanged

func IsFileChanged(src, dest string) (bool, error)

IsFileChanged reports whether src and dest config files are equal. Two config files are equal when they have the same file contents and Unix permissions. The owner, group, and mode must match. Returns false in other cases.

func ListFiles

func ListFiles(dir string, ext string) []string

ListFiles returns all file names in `dir`

func Lock

func Lock(name string) (io.Closer, error)

Lock ...

func MakeDirectory

func MakeDirectory(dirs ...string) error

MakeDirectory ...

func MkdirIfNecessary

func MkdirIfNecessary(createDir string) error

MkdirIfNecessary ...

func RecursiveDirsLookup

func RecursiveDirsLookup(root string, pattern string) ([]string, error)

RecursiveDirsLookup ...

func RecursiveFilesLookup

func RecursiveFilesLookup(root string, pattern string) ([]string, error)

RecursiveFilesLookup ...

Types

type FileInfo

type FileInfo struct {
	Uid  uint32
	Gid  uint32
	Mode os.FileMode
	Md5  string
}

fileInfo describes a configuration file and is returned by fileStat.

func FileStat

func FileStat(name string) (fi FileInfo, err error)

FileStat return a FileInfo describing the named file.

Jump to

Keyboard shortcuts

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