[comp.sys.ibm.pc] Determining write protection on floppys

stergios@rocky.UUCP (10/01/87)

Newsgroups: comp.sys.ibm.pc
Subject: Determining disk write protection in MSC
Expires: 
References: 
Sender: 
Reply-To: stergios@rocky.stanford.edu (Stergios Marinopoul)
Followup-To: 
Distribution: world
Organization: Stanford University Computer Science Department
Keywords: Help!

Howdy!  I need to determine if a floppy is write protected from MSC.
At first, I just fopen()'nd a file on a write protected floppy expecting 
the returning FILE *fp to be NULL if the disk was write proteced.  
Well, that did'nt work, but you probably guessed that by now 8^).  

Then I broke out Norton's 
"Programmers Guide" and tried the ol interrupt method.  Ya see I got
this idea to read in a sector, then try to write it back out, and then
check the disk status afterwards.  Messy, but kinda fun I thought.  The
only problem with this apporach is that the returned values are inconsistent.
(Yep, I tried both the int86() and the dosintx() after I learned the difference
between the two).

At this point I need some guidence.  Any one know of any method that
works?  I dont care how messey, so long as it works.

	thanks	stergios marinopoulos
		S&M Engineering

% UUCP:         !decwrl!rocky.stanford.edu!stergios			%
% ARPA:		f.flex@othello.stanford.edu				%
% USnail:	Crothers Memorial #690, Stanford, CA. 94305		%
% Pa Bell:	(415) 321-7678						%



-- 
% UUCP:         !decwrl!rocky.stanford.edu!stergios			%
% ARPA:		f.flex@othello.stanford.edu				%
% USnail:	Crothers Memorial #690, Stanford, CA. 94305		%
% Pa Bell:	(415) 321-7678						%