Documentation ¶
Overview ¶
Package types contains definitions for generic file system strings: - Drive - Mount point - Path - Virtual disk - Volume
Methods of these types do not verify object existence and do not call into OS-specific APIs related to a certain type of object.
Index ¶
Constants ¶
const IntPtrZero = uintptr(0)
const InvalidVDiskHandle = VDiskHandle(windows.InvalidHandle)
Variables ¶
var ErrorRetryLimitExceeded = errors.New("retry limit exceeded")
var ErrorTyping = errors.New("invalid type")
var PathSeparator = fmt.Sprintf("%c", os.PathSeparator)
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device Path
Device The returned string is an object under `\GLOBAL??`. Examples: - VHDX: `\\?\scsi#drives&ven_msft&prod_virtual_disk#2&1f4adffe&0&000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}` - NVMe drives: `\\?\scsi#drives&ven_msft&prod_virtual_disk#2&1f4adffe&0&000001#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}`
func (Device) AsFileNameW ¶
func (Device) AsObjectPathW ¶
type Drive ¶
type Drive Path
Drive path in the format of `\\.\PhysicalDrive0`.
func DriveFromId ¶
func (Drive) AsFileNameW ¶
func (Drive) AsObjectPathW ¶
type KernelObject ¶
type MountPoint ¶
type MountPoint Path
MountPoint is a reparse point. Examples: - `\\.\C:` - `\\.\C:\xxx\yyy`
func (MountPoint) AsDirectoryW ¶
func (mp MountPoint) AsDirectoryW() (*uint16, error)
func (MountPoint) AsFileNameW ¶
func (mp MountPoint) AsFileNameW() (*uint16, error)
type Path ¶
type Path string
Path represents a generic Windows path in the paths system, without assumption of its kind or existence.
func PathFromUTF16 ¶
func (Path) AsDirectory ¶
func (Path) AsFileName ¶
func (Path) AsFileNameW ¶
type VDiskHandle ¶
type Volume ¶
type Volume Path
Volume GUID path in the format of `\\?\Volume{00000000-0000-0000-0000-00000000000}\`. Note that a volume's path always end with `\`. https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-volume