QueryDosDevice translates the DOS device name to hard disk drive letter.
(drive string)
| 83 | |
| 84 | // QueryDosDevice translates the DOS device name to hard disk drive letter. |
| 85 | func QueryDosDevice(drive string) (string, error) { |
| 86 | dev := make([]uint16, windows.MAX_PATH) |
| 87 | _, err := windows.QueryDosDevice(windows.StringToUTF16Ptr(drive), &dev[0], windows.MAX_PATH) |
| 88 | if err != nil { |
| 89 | return "", err |
| 90 | } |
| 91 | return windows.UTF16ToString(dev), nil |
| 92 | } |
| 93 | |
| 94 | // PathIsDirectory determines if the provided path is a directory. |
| 95 | func PathIsDirectory(path string) bool { |