upspin

package
v1.85.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 10 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
}

File is an alternate implementation of upspin.File, which allows for opening a file for read and write at the same time. In contrast, it stores the data in-memory, to it should only be used over upspin.File when the all the data is usually read anyway. This File it's always readable so passing O_WRONLY or O_RDWR is equivalent.

func Open

func Open(
	client upspin.Client, name upspin.PathName, flag int,
) (*File, error)

NewFile opens or creates a new file with a given name and uses flag to determine if whether to create a file in case it doesn't exist O_CREATE and whether to open it in os.O_RDONLY or O_RDWR. If name points to a link, it will follow it.

func (*File) Close

func (f *File) Close() error

Close implements upspin.File.

func (*File) Name

func (f *File) Name() upspin.PathName

Name implements upspin.File.

func (*File) Read

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

Read implements upspin.File.

func (*File) ReadAt

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

ReadAt implements upspin.File.

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (ret int64, err error)

Seek implements upspin.File.

func (*File) Sync

func (f *File) Sync() (*upspin.DirEntry, error)

Sync writes the accumulated data to a StoreServer, if this file is writeable, otherwise it will return an error. It returns the updated DirEntry for the file.

func (*File) Truncate

func (f *File) Truncate(size int) error

Truncate changes the size of the file to size.

func (*File) Write

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

Write implements upspin.File.

func (*File) WriteAt

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

WriteAt implements upspin.File.

Jump to

Keyboard shortcuts

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