file

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2016 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndWrite

func CreateAndWrite(name string, r io.Reader) error

CreateAndWrite creates a file called "name" (or overwrites if it already existed), reads all of r into the file, then closes the file. Returns any errors encountered along the way.

func OpenAndStat

func OpenAndStat(path string) (*os.File, os.FileInfo, error)

openandStatFile calls os.Opena and os.Stat on path, returning the result of both calls if both were successful.

If either returned a non-nil error, returns errOpenFile or errStatFile (respectively) and nil for both the File and the FileInfo

Types

type ErrOpenFile

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

func (ErrOpenFile) Error

func (e ErrOpenFile) Error() string

type ErrStatFile

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

func (ErrStatFile) Error

func (e ErrStatFile) Error() string

type TmpDirCreator

type TmpDirCreator func(prefixFmt string, vals ...interface{}) (string, error)

func DefaultTmpDirCreator

func DefaultTmpDirCreator() TmpDirCreator

func LocalTmpDirCreator

func LocalTmpDirCreator() TmpDirCreator

Jump to

Keyboard shortcuts

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