osfs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 3 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 {
	*os.File
	// contains filtered or unexported fields
}

File implements vfs.File for the current target operating system.

func Open

func Open(path string, mode os.FileMode) (*File, error)

func (*File) Lock

func (f *File) Lock(exclusive, blocking bool) error

func (*File) MMap

func (f *File) MMap(sz int) ([]byte, error)

func (*File) MUnmap

func (f *File) MUnmap(b []byte) error

func (*File) Size

func (f *File) Size() (int64, error)

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

func (*File) Sync

func (f *File) Sync(flags vfs.SyncFlag) error

Sync uses fnctl or fsync in order to flush the file buffers to disk. According to the darwin fsync man page1, usage of sync is not safe. On darwin, fsync will only flush the OS file cache to disk, but this won't enforce a cache flush on the drive itself. Without forcing the cache flush, writes can still be out of order or get lost on power failure. According to the man page1 fcntl with F_FULLFSYNC2 is required. F_FULLFSYNC might not be supported for the current file system. In this case we will fallback to fsync.

func (*File) Truncate

func (f *File) Truncate(sz int64) error

func (*File) Unlock

func (f *File) Unlock() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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