volume

package
v0.0.0-...-c82c71a Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package volume provides high level access to disk volumes and file system functions.

Index

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

func New(path string) (*Volume, error)

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) BusType

func (v *Volume) BusType() uint32

BusType returns the hardware bus type of the volume.

func (*Volume) Close

func (v *Volume) Close() error

Close releases any resources consumed by the volume.

func (*Volume) DeviceID

func (v *Volume) DeviceID() ([]byte, error)

DeviceID returns the device ID of the volume.

func (*Volume) DeviceNumber

func (v *Volume) DeviceNumber() uint32

DeviceNumber returns the physical device number of the volume.

func (*Volume) DevicePath

func (v *Volume) DevicePath() (string, error)

DevicePath returns an NT namespace device path for the volume.

func (*Volume) DeviceType

func (v *Volume) DeviceType() uint16

DeviceType returns the type of device represented by the volume.

func (*Volume) GUID

func (v *Volume) GUID() (guid windows.GUID, err error)

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) Handle

func (v *Volume) Handle() syscall.Handle

Handle returns the system handle of the volume.

func (*Volume) Journal

func (v *Volume) Journal() *usn.Journal

Journal returns a change journal accessor for the volume.

func (*Volume) Label

func (v *Volume) Label() (string, error)

Label returns the label of the volume.

func (*Volume) MFT

func (v *Volume) MFT() *usn.MFT

MFT returns an MFT for the volume.

func (*Volume) Name

func (v *Volume) Name() (string, error)

Name returns the volume GUID name.

BUG: This currently only works for device drivers that supply a stable GUID.

func (*Volume) PartitionNumber

func (v *Volume) PartitionNumber() int32

PartitionNumber returns the partition number of the volume.

func (*Volume) Paths

func (v *Volume) Paths() ([]string, error)

Paths returns all of the volume's mount points.

func (*Volume) ProductID

func (v *Volume) ProductID() string

ProductID returns the hardware product ID of the volume.

func (*Volume) ProductRevision

func (v *Volume) ProductRevision() string

ProductRevision returns the hardware product revision of the volume.

func (*Volume) RemovableMedia

func (v *Volume) RemovableMedia() bool

RemovableMedia returns true if the volume is located on removable media.

func (*Volume) SerialNumber

func (v *Volume) SerialNumber() string

SerialNumber returns the hardware serial number of the volume.

func (*Volume) StableGUID

func (v *Volume) StableGUID() (guid windows.GUID, err error)

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().

func (*Volume) VendorID

func (v *Volume) VendorID() string

VendorID returns the hardware vendor ID of the volume.

Jump to

Keyboard shortcuts

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