get_logical_drives

Definition: sequence res = get_logical_drives()
Description: Returns a list of {string drive, integer drivetype} pairs.
Comments: The following drivetypes are pre-defined in psym.e:
global constant DRIVE_UNKNOWN       = 0,    -- The drive type cannot be determined.
                DRIVE_NO_ROOT_DIR   = 1,    -- The root path is invalid; for example, there is no volume mounted at the specified path.
                DRIVE_REMOVABLE     = 2,    -- The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.
                DRIVE_FIXED         = 3,    -- The drive has fixed media; for example, a hard disk drive or flash drive.
                DRIVE_REMOTE        = 4,    -- The drive is a remote (network) drive.
                DRIVE_CDROM         = 5,    -- The drive is a CD-ROM drive.
                DRIVE_RAMDISK       = 6     -- The drive is a RAM disk.

On Windows, wraps the kernel32 function GetLogicalDriveStrings (rather than GetLogicalDrives which returns a bitmask) and GetDriveType.
On Linux, simply returns {{"/",DRIVE_FIXED}}.

The implementation of this routine can be found in builtins/pfile.e - and is open to suggestions for enhancement.
Example:
?get_logical_drives()   -- prints eg {{"C:\\",3},{"D:\\",5},{"E:\\",3},{"F:\\",6},{"G:\\",2}} 
See Also: dir