MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / GetLogicalDrives

Function GetLogicalDrives

pkg/sys/fs.go:69–82  ·  view source on GitHub ↗

GetLogicalDrives returns available device drive letters in the system.

()

Source from the content-addressed store, hash-verified

67
68// GetLogicalDrives returns available device drive letters in the system.
69func GetLogicalDrives() []string {
70 bitmask, err := windows.GetLogicalDrives()
71 if err != nil {
72 return nil
73 }
74 devs := make([]string, 0)
75 for _, drive := range drives {
76 if bitmask&1 == 1 {
77 devs = append(devs, drive+":")
78 }
79 bitmask >>= 1
80 }
81 return devs
82}
83
84// QueryDosDevice translates the DOS device name to hard disk drive letter.
85func QueryDosDevice(drive string) (string, error) {

Callers 1

NewDevMapperFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected