Mail Archives: djgpp/1993/04/28/11:01:46
>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 -