Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing to floppy
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00330178
Message ID:
00330616
Views:
10
Hi:

Here is another way.

IF NOT IsDiskin("a:")
= MESSAGEBOX("Drive 'A:' not available")
ENDIF

FUNCTION IsDiskIn
LPARAMETERS tcDrive
*
* Defines from Winbase.h
*
#DEFINE SEM_FAILCRITICALERRORS 0x0001
#DEFINE SEM_NOGPFFAULTERRORBOX 0x0002
#DEFINE SEM_NOALIGNMENTFAULTEXCEPT 0x0004
#DEFINE SEM_NOOPENFILEERRORBOX 0x8000

*
* SetErrorMode determines whether the system handles serious errors
* or whether the program handles them
*
DECLARE INTEGER SetErrorMode IN win32api INTEGER

*
* Declare local variables
*
LOCAL lnResult,llIsDisIn,lcDrive

*
* Initilize
*
llIsDisIn = .F.
lnResult = 0
lcDrive = tcDrive

*
* Turn off critical errors
*
lnResult = SetErrorMode(SEM_FAILCRITICALERRORS)

*
* Check and see if the disk is in
*
IF DISKSPACE(lcDrive) = -1
llIsDisIn = .F.
ELSE
llIsDisIn = .T.
ENDIF

*
* Reset the thing the way we found them
*
lnResult = SetErrorMode(lnResult)

*
* Return the result
*
RETURN llIsDisIn
ENDFUNC
HTH,

--Paul


>Dear All:
>
>Back in the FoxPro for Windows days I was using a third party library called ZDRVSTAT to check the status of my diskettes when writing files to diskettes.
>
>It was never updated. What can I use to check disk status and handle properly the input/output problems when writing to diskette?
>
>Thanks in advance,
>Bruce Strom
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform