file

package
v0.0.0-...-9ccd474 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

func New

func New(fd int) *File

func (*File) Close

func (f *File) Close() error

func (*File) FD

func (f *File) FD() int

func (*File) Fd

func (f *File) Fd() uintptr

func (*File) Read

func (f *File) Read(b []byte) (n int, err error)

func (*File) ReadAt

func (f *File) ReadAt(b []byte, offset int64) (n int, err error)

func (*File) WriteAt

func (f *File) WriteAt(b []byte, offset int64) (n int, err error)

func (*File) WriteVec

func (f *File) WriteVec(bufs [2][]byte) error

func (*File) WriteVecAt

func (f *File) WriteVecAt(bufs [2][]byte, offset int64) (err error)

type Ref

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

func Own

func Own(fd int) Ref

func (*Ref) File

func (ref *Ref) File() *File

File gets a temporary pointer to the referenced file, or nil.

func (*Ref) MustRef

func (ref *Ref) MustRef() Ref

MustRef increments reference count or panics.

func (*Ref) Ref

func (ref *Ref) Ref() Ref

Ref increments reference count if there is a referenced file.

func (*Ref) Unref

func (ref *Ref) Unref()

Unref decrements reference count. File is closed when reference count drops to zero.

Jump to

Keyboard shortcuts

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