fnspath

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: MIT Imports: 9 Imported by: 1

README

fnspath

Various path utils.

Documentation

Index

Constants

View Source
const (
	RemoveAttempts int = 20
	MvAttempts     int = 20
)

Variables

This section is empty.

Functions

func AbsentMany

func AbsentMany(paths []string) (err error)

func Absolutize

func Absolutize(paths []*string) error

func Clear

func Clear(path string) (err error)

func CopyFile

func CopyFile(source string, dest string, mode os.FileMode) error

func CopyFileEnsureDir

func CopyFileEnsureDir(src string, dst string, fileMode os.FileMode, dirMode os.FileMode) error

func Ensure

func Ensure(path string, perm os.FileMode) error

func EnsureMany

func EnsureMany(paths PathAndModes) error

func IsDirEmpty

func IsDirEmpty(name string) (bool, error)

func IsExists

func IsExists(path string) (bool, error)

func MV

func MV(oldpath, newpath string) (e error)

func MkdirAll

func MkdirAll(path string, perm os.FileMode) error

func PathCopyDir

func PathCopyDir(source string, dest string) (err error)

func Remove

func Remove(path string) (e error)

func RemoveFileOKEvenIfNotExists

func RemoveFileOKEvenIfNotExists(path string) (e error)

func Rename

func Rename(oldpath, newpath string, mode os.FileMode) error

func ToFile

func ToFile(path string, mode os.FileMode, reader io.Reader) error

func WriteFile

func WriteFile(path string, dirMode, fileMode os.FileMode, src io.Reader) (int64, error)

Types

type MD5

type MD5 struct {
	Latency time.Duration // calculation latency
	Sum     [md5.Size]byte
	Sz      uint64
	B       *bufpool.Buf
}

func (*MD5) Do

func (m5 *MD5) Do(path string) error

func (*MD5) Release

func (m5 *MD5) Release()

type PathAndModes

type PathAndModes []pathAndMode

func NewPathAndModes

func NewPathAndModes() PathAndModes

func (*PathAndModes) Append

func (pam *PathAndModes) Append(path string, mode os.FileMode)

Jump to

Keyboard shortcuts

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