fsutil

package
v0.0.0-...-e9d8828 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFilePerms

func GetFilePerms(filename string) (os.FileMode, error)

func GetFileSize

func GetFileSize(filename string) (int64, error)

func MustExecutableFolder

func MustExecutableFolder() string

Get the current executable's folder or fail

func MustGetFileSize

func MustGetFileSize(filename string) int64

func MustLookupPaths

func MustLookupPaths(paths ...string)

Exit with a panic if paths do not exist as command executables

func MustPathExist

func MustPathExist(paths ...string)

Exit Panicly if path does not exist

func MustPathNotExist

func MustPathNotExist(paths ...string)

Exit Panicly if path exists

func MustTemporaryFileWithContent

func MustTemporaryFileWithContent(dir string, prefix string, content []byte, mode os.FileMode) string

Creates a temporary file with the given content and returns the filename. Panics if any error occurs.

func PathExists

func PathExists(path string) bool

Path does not exist

func PathNotExist

func PathNotExist(path string) bool

Path exists

func TemporaryFileWithContent

func TemporaryFileWithContent(dir string, prefix string, content []byte, mode os.FileMode) (string, error)

Creates a temporary file with the given content and returns the filename

Types

type ErrPath

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

func (ErrPath) Error

func (this ErrPath) Error() string

func (ErrPath) Path

func (this ErrPath) Path() string

func (ErrPath) WrappedErrors

func (this ErrPath) WrappedErrors() []error

type ErrTemporaryFile

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

ErrPath is returned as the panic() context when a Must function is invoked as a wrapped error..

func (ErrTemporaryFile) Dir

func (this ErrTemporaryFile) Dir() string

func (ErrTemporaryFile) Error

func (this ErrTemporaryFile) Error() string

func (ErrTemporaryFile) Prefix

func (this ErrTemporaryFile) Prefix() string

func (ErrTemporaryFile) WrappedErrors

func (this ErrTemporaryFile) WrappedErrors() []error

Jump to

Keyboard shortcuts

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