| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Determines or changes the current disk drive
CurDrive( [<cNewDrive>] ) --> cOldDrive
The function returns the a single letter specifying the disk drive that is current before the function is called (the previous disk drive).
CurDrive() queries the current disk drive and optionally changes to a new one. The new disk drive to change to is specified with <cNewDrive>.
Use function IsDisk() to check for the existence of a disk drive.
| See also: | CurDir(), DiskChange(), DiskName(), DiskSpace(), Getenv(), IsDisk(), SET DEFAULT, SET PATH |
| Category: | Disks and Drives , File functions |
| Source: | rtl\philesx.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example queries and changes the current disk drive
// and displays the current directory for each drive.
PROCEDURE Main
? CurDrive( "C:" ) // result: D
? CurDrive() // result: C
? CurDir() // result: temp
? CurDrive( "D" ) // result: C
? CurDir() // result: xhb\source\samples
? CurDrive() // result: D
? CurDir() // result: xhb\source\samples
RETURN
http://www.xHarbour.com