Help with Dos write protect error
Mark Tutt
Mark.Tutt at f88.n363.z1.fidonet.org
Sun Mar 24 00:59:09 AEST 1991
bla> I am using MSC 5.1 and am trying to find a high level dos or possibly
bla> bios
bla> call to determine the status of the disk drive. In particular I am
bla> trying
bla> to detect what the status of the write protect tab is. My problem stems
bla> from the fact that I get a write protect error Abort, Retry, Ignore?
bla> message
bla> when I try to write to a file using fopen and fprintf. I would like to
bla> detect the status before I write to the file so that dos doesn't have a
bla> chance to display it's error. I have looked in many books and dos
bla> manuals
bla> for bios calls with no luck.
What you are looking for is INT 13H Function 01H. It will return 03H in the AL
register if the disk is write protected. However, what it returns is the info
from the most recent disk operation, so you would have to call another disk
function before calling this one. Perhaps INT 13 Function 00H, reset disk
system would be the safest.
Hope this helps!
Mark
--
Mark Tutt - via FidoNet node 1:363/42
UUCP:
ARPA: Mark.Tutt at f88.n363.z1.fidonet.org
\
More information about the Comp.lang.c
mailing list