Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixFile Functions (continued)

GetVolumeType Function

Overview

The GetVolumeType function retrieves the type of physical or logical device mapped to the drive letter.

Syntax/Parameters

Syntax

int = GetVolumeType ( string volume );

Parameters

volume

A string containing the drive letter. Any characters after the first letter are ignored.

Return Value

Returns an int specifying the type of device or -1 on failure. Use the GetLastError function to retrieve error information. The lower word portion of the error code will contain the Windows SDK drive type code (normally 0 or 1 for unknown device or for no root directory on device).

The return codes are as follows (as defined in the Legato and Windows SDK):

  Define Value   Comment
  DRIVE_UNKNOWN   0   Function returns as error
  DRIVE_NO_ROOT_DIR   1   Function returns as error
  DRIVE_REMOVABLE   2   SD, Thumb Drive, etc...
  DRIVE_FIXED   3   Local, (typically C drive)
  DRIVE_REMOTE   4   Network share
  DRIVE_CDROM   5   CD or DVD drive
  DRIVE_RAMDISK   6   RAM (memory based) disk

 

Remarks

The GetVolumeType function does not test whether the volume actually exists, only that it is mapped. For example, the function will return without error for a CD or DVD drive when the drive is empty. Any data in the volume parameter after the drive letter is ignored.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic