www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/04/28/11:01:46

Date: Wed, 28 Apr 93 10:10:38 EDT
From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock)
To: a_tucker AT paul DOT spu DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: managing diff's

>I've been writing a disk cataloging program as well, but have caught up on
>a snag lately.  How do I detect write protection on a disk without hurting
>it?

As far as I know, the only reliable way of detecting write protection is to
try to write to the disk and catch the failure with a critical error handler
(or int 26).  I can think of one trick which might work, but I _strongly_
recommend against using it: read the disk to find out how many tracks it has,
then try to format one track beyond the last.  Usually a drive will let you
write a few extra tracks.  But, hardware or software may prevent you from
doing this, and possibly clobber the last valid track instead.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019