xpath

package
v0.0.0-...-89edfd8 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SLASH              = string(os.PathSeparator)
	DEFAULT_DIR_ACCESS = 0755
)
View Source
const (
	All = iota
	Files
	Folders
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Path

type Path struct {
	// contains filtered or unexported fields
}

func New

func New(path string) (Path, error)

func (*Path) BaseName

func (p *Path) BaseName() string

func (*Path) CopyFile

func (p *Path) CopyFile(src, dst string) (err error)

func (*Path) CreateDirIfNotExist

func (p *Path) CreateDirIfNotExist(dirname string) error

func (*Path) FileExists

func (p *Path) FileExists(filename string) bool

func (*Path) FileExtension

func (p *Path) FileExtension(filename string) string

func (*Path) FileMode

func (p *Path) FileMode(filename string) (os.FileMode, error)

func (*Path) FileSize

func (p *Path) FileSize(filename string) (int64, error)

func (*Path) FormatPath

func (p *Path) FormatPath() string

func (*Path) GetFileMd5

func (p *Path) GetFileMd5(filename string) string

func (*Path) GetFilenameNoExtension

func (p *Path) GetFilenameNoExtension(filename string) string

func (*Path) GetPath

func (p *Path) GetPath() string

func (*Path) GetRawPath

func (p *Path) GetRawPath() string

func (*Path) IsDir

func (p *Path) IsDir(dirname string) (bool, error)

func (*Path) IsExist

func (p *Path) IsExist(name string) (bool, error)

func (*Path) ListAll

func (p *Path) ListAll() []string

func (*Path) ListFiles

func (p *Path) ListFiles() []string

func (*Path) ListFilesAll

func (p *Path) ListFilesAll() []string

func (*Path) ListFilesRecursive

func (p *Path) ListFilesRecursive(prefix string, pa string, b bool) []string

func (*Path) ListFilesType

func (p *Path) ListFilesType(ext string) []string

func (*Path) ListFolders

func (p *Path) ListFolders() []string

func (*Path) ListFoldersAll

func (p *Path) ListFoldersAll() []string

func (*Path) MkDir

func (p *Path) MkDir(dirname string) error

func (*Path) MkDirSpecificMode

func (p *Path) MkDirSpecificMode(dirname string, mode os.FileMode) error

func (*Path) ModTime

func (p *Path) ModTime() (time.Time, error)

func (*Path) ParentPath

func (p *Path) ParentPath() string

func (*Path) RelativePath

func (p *Path) RelativePath(filename string) string

func (*Path) RemoveFileIfExist

func (p *Path) RemoveFileIfExist(filename string) error

func (*Path) Run

func (p *Path) Run(cmd string, shell bool) (string, error)

func (*Path) SearchFile

func (p *Path) SearchFile(filename string) (fullpath string, err error)

SearchFile Search a file in paths. this is often used in search config file in /etc ~/

func (*Path) SplitPath

func (p *Path) SplitPath() []string

func (*Path) TempDir

func (p *Path) TempDir() string

func (*Path) UpdatePath

func (p *Path) UpdatePath(path string)

Jump to

Keyboard shortcuts

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