Documentation
¶
Index ¶
- type File
- func (f *File) Close() error
- func (f *File) Name() upspin.PathName
- func (f *File) Read(b []byte) (n int, err error)
- func (f *File) ReadAt(b []byte, off int64) (n int, err error)
- func (f *File) Seek(offset int64, whence int) (ret int64, err error)
- func (f *File) Sync() (*upspin.DirEntry, error)
- func (f *File) Truncate(size int) error
- func (f *File) Write(b []byte) (n int, err error)
- func (f *File) WriteAt(b []byte, off int64) (n int, err error)
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 ¶
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) Sync ¶
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.