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

View Source
const (
	ERROR_DISK_FULL             syscall.Errno = 62
	ERROR_DISK_QUOTA_EXCEEDED   syscall.Errno = 1295
	ERROR_TOO_MANY_OPEN_FILES   syscall.Errno = 4
	ERROR_LOCK_FAILED           syscall.Errno = 167
	ERROR_CANT_RESOLVE_FILENAME syscall.Errno = 1921
)

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 FlushFileBuffers to flush all file buffers to disk. For more information about the operation executed check the FlushFileBuffers API docs1.

Depending on Windows+driver versions or system wide settings, FlushFileBuffers might not be reliable. While FlushFileBuffers flushes the OS disk cache, we require a FLUSH_CACHE to be executed and honored by the driver and the device. Otherwise we might suffer data loss and file corruption. Also see 2 and 3.

Enabling write caching on the disk 4 can disable the FLUSH_CACHE command, potentially leading to data loss and file corruption if the disk looses power.

Check 5, for why we don't want to use write through.

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