Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!van-bc! From: lphillips@lpami.wimsey.bc.ca (Larry Phillips) Newsgroups: comp.sys.amiga Subject: Re: Can I Protect My Hard Drive From Myself? Message-ID: <946@lpami.wimsey.bc.ca> Date: 27 Dec 89 12:28:54 GMT Lines: 67 Return-Path: To: van-bc!rnews In <842@dsacg2.UUCP>, nor1675@dsacg2.UUCP (Michael Figg) writes: >In article <11117@venera.isi.edu>, schur@venera.isi.edu (Sean Schur) writes: >> >>I know that one solution would be to pre-format disks so that MRBackup wouldn't >> try to format my hard disk erroneously. Unfortunately, I have a lot of ANIM > >After doing somewhat the same thing (I did a format on dh0: instead of df0:) I >thought a good solution might be to hide the 'format' command under another >name and call it from a script or simple program (named 'format') that traps >the device to be formatted, checks to see if it is one of your hard disk >partitions, and either warns you or forbids you to format the undesired >partition. > >I haven't tried this yet (but have made good backups!) and would welcome any >ideas on potential problems with this setup. If you like this sort of thing, it's easy to do in ARexx. Here's a simple example. You can fiddle with it and make it as smart as you want. If you are not using WShell, you will need to change the calls to C:FORMAT to address command 'c:format' x A real paranoid would put format in another directory and perhaps under a different name, just in case some nasty trojan horse calls it. ----------------------------------- /* format - front end for the format command */ parse arg x if find('DH2: DH1: DH0:',translate(word(x,2))) > 0 then call refuse if find('FF2: FF1: FF0:',translate(word(x,2))) > 0 then call warning 'c:format' x exit refuse: say say 'Better use C:FORMAT if you really mean it!' call whew exit warning: procedure expose x say say 'Are you really sure you want to format' word(x,2) || '?' pull response if translate(response) = 'YES' then 'c:format' x else nop whew: say 'Whew! That was close. Send Larry a dollar.' ------------------------ -larry -- " All I ask of my body is that it carry around my head." - Thomas Alva Edison - +-----------------------------------------------------------------------+ | // Larry Phillips | | \X/ lphillips@lpami.wimsey.bc.ca -or- uunet!van-bc!lpami!lphillips | | COMPUSERVE: 76703,4322 -or- 76703.4322@compuserve.com | +-----------------------------------------------------------------------+