Documentation
¶
Overview ¶
Package block enables programmatic access to block devices.
Index ¶
- Variables
- type Device
- func (d Device) Close() error
- func (d Device) Identify() ([512]byte, error)
- func (d Device) Read(b []byte) (int, error)
- func (d Device) ReadAt(b []byte, off int64) (int, error)
- func (d Device) Seek(offset int64, whence int) (int64, error)
- func (d Device) Size() (uint64, error)
- func (d Device) Write(b []byte) (int, error)
- func (d Device) WriteAt(b []byte, off int64) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotBlockDevice is returned when a device name passed to New is // not a block device. ErrNotBlockDevice = errors.New("not a block device") // ErrNotImplemented is returned when block device functionality is not // implemented on the current platform. ErrNotImplemented = errors.New("not implemented") )
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
A Device represents a block device. It can be used to query information about the device, seek the device, or read and write data.
func New ¶
New attempts to open a block device with the specified flags, and verifies that device is a block device.
If device is not a block device, ErrNotBlockDevice is returned.
func (Device) Close ¶
func (d Device) Close() error
Close closes the file descriptor for a block device.
Click to show internal directories.
Click to hide internal directories.