Routines (alphabetical) > Routines: G > GET_DRIVE_LIST

# GET_DRIVE_LIST

The GET_DRIVE_LIST function returns valid drive or volume names for the file system. Under Microsoft Windows, keywords can be used to specify that only drives of certain types should be returned.

Note: The UNIX operating system presents all files within a single unified file hierarchy, and does not support the concept of drive letters or volume names. As such, GET_DRIVE_LIST always returns a scalar null string under UNIX.

## Examples

Under Windows, the following will report all local hard drives:

drives = GET_DRIVE_LIST(/FIXED)
print, drives

This statement obtains the names of all floppy drives, cdroms, and other removable media drives:

drives = GET_DRIVE_LIST(/CDROM, /REMOVABLE)
print, drives

## Syntax

Result= GET_DRIVE_LIST( [, COUNT=variable] )

Windows-Only Keywords: [, /CDROM] [, /FIXED] [, /REMOTE] [, /REMOVABLE]

## Return Value

Returns a string array of the names of valid drives / volumes for the file system. If GET_DRIVE_LIST has no drives to return, it returns a scalar null string.

## Arguments

None.

## Keywords

Note: If a Windows-only keyword is specified, only drives of the specified types are reported.

### CDROM

This keyword is only available on Windows platforms.

If set, compact disk drives are reported. Note that although CDROM devices are removable, they are treated as a special case, and the REMOVABLE keyword does not apply to them.

### COUNT

A named variable into which the number of drives/volumes found is placed. If no drives/volumes are found, a value of zero is returned. Under UNIX, the value returned by this keyword will always be zero.

### FIXED

This keyword is only available on Windows platforms.

If set, hard drives physically attached to the current system are reported.

### REMOTE

This keyword is only available on Windows platforms.

If set, remote (i.e. network) drives are reported.

### REMOVABLE

This keyword is only available on Windows platforms.

If set, removable media devices (e.g. floppy, zip drive) other than CDROMs are reported.

## Version History

5.3 | Introduced