scotth@metheus.UUCP (Scott Huskey) (01/14/87)
Does anyone out there know how a program can check if a DISK is write protected or not? I would like my program (a game) to NOT write out the high scores if the disk is write protected. I do not want to bother the user (player) with a GEM error message. Is there a GEMDOS call or some type of memory peek? Do I need to talk to the disk controller directly? Scott Huskey UUCP: tektronix!ogcvax!metheus!scotth
fischer-michael@YALE.ARPA (Michael Fischer) (01/19/87)
In-reply-to: tektronix!sequent!ogcvax!metheus!scotth@ucbvax.Berkeley.EDU (Scott Huskey) > Does anyone out there know how a program can check if a DISK > is write protected or not? I would like my program (a game) > to NOT write out the high scores if the disk is write protected. > I do not want to bother the user (player) with a GEM error message. > Is there a GEMDOS call or some type of memory peek? Do I need to > talk to the disk controller directly? Simply attempt the write and look at the returned error code to tell if the write succeeded or not. If it failed, the error code should tell you if the problem is the disk being write protected, in which case you don't need to bother the user with an error message. (All this assumes of course that you are using the GEMDOS calls directly.) --Mike Fischer <fischer@yale.arpa> -------