io

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = bufferSize

	SeekStart   = io.SeekStart
	SeekCurrent = io.SeekCurrent
	SeekEnd     = io.SeekEnd
)

Variables

View Source
var (
	ErrShortWrite    = io.ErrShortWrite
	ErrShortBuffer   = io.ErrShortBuffer
	EOF              = io.EOF
	ErrUnexpectedEOF = io.ErrUnexpectedEOF
	ErrNoProgress    = io.ErrNoProgress
)

Functions

func Close

func Close(closers ...io.Closer) error

func CloseOr

func CloseOr(handleErr func(err error), closers ...io.Closer)

func CloseOrPanic

func CloseOrPanic(closers ...io.Closer)

func CloseQuietly

func CloseQuietly(closers ...io.Closer)

func Copy added in v0.1.3

func Copy(dst io.Writer, src io.Reader) (written int64, err error)

func CopyBuffer added in v0.1.3

func CopyBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err error)

func CopyN added in v0.1.3

func CopyN(dst io.Writer, src io.Reader, n int64) (written int64, err error)

func DirsEqual

func DirsEqual(path1, path2 string) (equal bool, err error)

func Exists

func Exists(path string) (bool, error)

func FilesEqual

func FilesEqual(path1, path2 string) (equal bool, err error)

func IsDir

func IsDir(path string) (bool, error)

func IsEmpty added in v0.4.2

func IsEmpty(path string) (bool, error)

Returns true iff the path entry exists and is one of: 1. A directory with no children. 2. A regular file of zero length.

func IsFile

func IsFile(path string) (bool, error)

func IsParentDir

func IsParentDir(path string) (bool, error)

Returns true iff the parent of this path exists and is a directory.

func Junction

func Junction(directory, junction string) error

func LimitReader added in v0.1.3

func LimitReader(r io.Reader, n int64) io.Reader

func Parent

func Parent(path string) (string, error)

func ReadAtLeast added in v0.1.3

func ReadAtLeast(r io.Reader, buf []byte, min int) (n int, err error)

func ReadFull added in v0.1.3

func ReadFull(r io.Reader, buf []byte) (n int, err error)

func WriteString added in v0.1.3

func WriteString(w io.Writer, s string) (n int, err error)

Types

type Diff

type Diff struct {
	Item1 *FileInfo
	Item2 *FileInfo
}

func DiffDirs

func DiffDirs(path1, path2 string) (diffs []Diff, err error)

type FileInfo

type FileInfo struct {
	FullPath string
	os.FileInfo
}

func (FileInfo) IsFile

func (fi FileInfo) IsFile() bool
func (fi FileInfo) IsSymlink() bool

func (FileInfo) String

func (fi FileInfo) String() string

Jump to

Keyboard shortcuts

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