Documentation ¶
Overview ¶
Package volume provides high level access to disk volumes and file system functions.
Index ¶
- type Volume
- func (v *Volume) BusType() uint32
- func (v *Volume) Close() error
- func (v *Volume) DeviceID() ([]byte, error)
- func (v *Volume) DeviceNumber() uint32
- func (v *Volume) DevicePath() (string, error)
- func (v *Volume) DeviceType() uint16
- func (v *Volume) GUID() (guid windows.GUID, err error)
- func (v *Volume) Handle() syscall.Handle
- func (v *Volume) Journal() *usn.Journal
- func (v *Volume) Label() (string, error)
- func (v *Volume) MFT() *usn.MFT
- func (v *Volume) Name() (string, error)
- func (v *Volume) PartitionNumber() int32
- func (v *Volume) Paths() ([]string, error)
- func (v *Volume) ProductID() string
- func (v *Volume) ProductRevision() string
- func (v *Volume) RemovableMedia() bool
- func (v *Volume) SerialNumber() string
- func (v *Volume) StableGUID() (guid windows.GUID, err error)
- func (v *Volume) VendorID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Volume ¶
type Volume struct {
// contains filtered or unexported fields
}
Volume represents a storage volume. It must be created with a call to New.
func New ¶
New returns a volume representing the volume of the given path, which must be in one of the following formats:
\\.\X: \\?\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\ \\.\PhysicalDrive0
The returned volume will wrap a system handle and will consume system resources until the volume is closed. It is the caller's responsibility to close the volume when finished with it.
func (*Volume) DeviceNumber ¶
DeviceNumber returns the physical device number of the volume.
func (*Volume) DevicePath ¶
DevicePath returns an NT namespace device path for the volume.
func (*Volume) DeviceType ¶
DeviceType returns the type of device represented by the volume.
func (*Volume) GUID ¶
GUID returns a GUID for the volume that is supplied by the mount manager.
If the underlying device driver supplies a stable GUID, the mount manager will use and return that value.
BUG: This currently only works for device drivers that supply a stable GUID.
func (*Volume) Name ¶
Name returns the volume GUID name.
BUG: This currently only works for device drivers that supply a stable GUID.
func (*Volume) PartitionNumber ¶
PartitionNumber returns the partition number of the volume.
func (*Volume) ProductRevision ¶
ProductRevision returns the hardware product revision of the volume.
func (*Volume) RemovableMedia ¶
RemovableMedia returns true if the volume is located on removable media.
func (*Volume) SerialNumber ¶
SerialNumber returns the hardware serial number of the volume.
func (*Volume) StableGUID ¶
StableGUID returns a stable GUID for the volume that is supplied by its device driver.
Not all device drivers are capable of supplying a stable GUID. If this device doesn't supply one an error will be returned. In such cases the mount manager will generate a GUID for the volume, which can be accessed via v.GUID().