Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disk In Drive?

Status
Not open for further replies.

gorepj

IS-IT--Management
Jul 1, 2000
11
GB
How can I determine if there is a diskette inserted into drive A: without spawning the system error ABORT, CONTINUE,FAIL?
 
[tt]
*-------------------------------------------------------
* Function.: DiskType
* Abstract.: Returns a number indicating the type of the drive.
* Returns.: Number indicating the DriveType :
* 0 : DRIVE_UNKNOWN : The drive type cannot be determined.
* 1 : DRIVE_NO_ROOT_DIR : The root path is invalid. For example, no volume is mounted at the path.
* 2 : DRIVE_REMOVABLE : The disk can be removed from the drive.
* 3 : DRIVE_FIXED : The disk cannot be removed from the drive.
* 4 : DRIVE_REMOTE : The drive is a remote (network) drive.
* 5 : DRIVE_CDROM : The drive is a CD-ROM drive.
* 6 : DRIVE_RAMDISK : The drive is a RAM disk.
* Parameters..: RootPathName ("c:\"), plWinApi - logical - If you want to use Win98/2000 Api functions
*-------------------------------------------------------
PARAMETERS pcRootPath , plWinApi
if para() < 1 .or. type(&quot;pcRootPath&quot;) != &quot;C&quot; .or. empty(pcRootPath)
pcRootPath = sys(5)
endif
if plWinApi
declare long GetDriveTypeA in &quot;KERNEL32&quot; as &quot;APIGetDriveType&quot; string nDrive
lnReturn = APIGetDriveType(pcRootPath)
else
set library to (home()+&quot;FOXTOOLS.FLL&quot;)
lnReturn = DriveType(pcRootPath)
set library to
endif
RETURN lnReturn
[/tt]
David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top