Documentation
¶
Index ¶
- type File
- func (f *File) Lock(exclusive, blocking bool) error
- func (f *File) MMap(sz int) ([]byte, error)
- func (f *File) MUnmap(b []byte) error
- func (f *File) Size() (int64, error)
- func (f *File) Stat() (os.FileInfo, error)
- func (f *File) Sync(flags vfs.SyncFlag) error
- func (f *File) Truncate(sz int64) error
- func (f *File) Unlock() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
File implements vfs.File for the current target operating system.
func (*File) Sync ¶
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.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.