utils

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WinPathSeperator  string = ";"
	UnixPathSeperator string = ":"
)
View Source
const (
	LinuxInstallerApt string = "apt"
	LinuxInstallerYum string = "yum"
	LinuxInstallerDnf string = "dnf"
)

Variables

This section is empty.

Functions

func CreateSymLink(oldname, newname string) (err error)

Create symbolic links for directories.

func DNForAPTonLinux

func DNForAPTonLinux() string

func DecompressBySystemCommand added in v0.6.2

func DecompressBySystemCommand(srcPath, dstDir string) (err error)

func Extract

func Extract(srcFile, destDir string) (err error)

Decompress archived files.

func GetFileLastModifiedTime

func GetFileLastModifiedTime(fPath string) int64

func JoinPath

func JoinPath(pathStr ...string) (s string)

func MoveFileOnUnixSudo

func MoveFileOnUnixSudo(from, to string) error

func OpenURL

func OpenURL(dUrl string) error

func Untar added in v0.6.2

func Untar(srcPath, dstDir string) (err error)

func Unzip added in v0.6.2

func Unzip(srcPath, dstDir string) (err error)

func UseArchiver

func UseArchiver(srcPath string) bool

use archiver or xtract.

Types

type HomeDirFinder

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

Find home dir of unzipped directories.

func NewFinder

func NewFinder(flagFiles ...string) (h *HomeDirFinder)

func (*HomeDirFinder) Clear

func (h *HomeDirFinder) Clear()

func (*HomeDirFinder) Find

func (h *HomeDirFinder) Find(startDir string)

func (*HomeDirFinder) GetDirName

func (h *HomeDirFinder) GetDirName() string

func (*HomeDirFinder) SetFlagDirExcepted

func (h *HomeDirFinder) SetFlagDirExcepted(ok bool)

func (*HomeDirFinder) SetFlags

func (h *HomeDirFinder) SetFlags(flagFiles ...string)

Jump to

Keyboard shortcuts

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