xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

DriveType()

Determines the type of a drive.

Syntax

DriveType( [<cDrive>] ) --> nDriveType

Arguments

<cDrive>
This parameter defaults to the current drive letter. It can be specified as a drive letter from A to Z without a colon.

Return

The function returns a numeric value indicating the type of the specified drive. The following values are possible:

Codes for drive types
ReturnDrive type
0RAM drive
2Floppy drive
3Hard drive
4CD-Rom drive
5Network drive
9Unknown drive

Info

See also:DiskName()
Category: CT:DiskUtil , Disks and Drives
Source:ct\disk.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example lists the types of 26 possible drives and their capacity

   PROCEDURE Main
     LOCAL cDrive, i

     CLS

     FOR i:=1 TO 26
        cDrive := Chr(64+i)
        ? cDrive, DriveType( cDrive), DiskTotal( cDrive )
     NEXT
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe