[comp.sys.mac.programmer] Disabling the trashcan

jhenk@hmcvax.claremont.edu (05/08/91)

   Hello. A freind of mine is teaching a class (second grade) and is using the
Mac as a teaching tool. Everything is fine except that the kids have discovered
the trash can to be a wonderful toy for dragging files to. Wonderful. Instead
of getting on the kids cases, he has asked me to write hima simple(?)
application to disable the trash can. Since I can't find much on that
particular problem, I need to bounce this off someone and see if my idea has
any merit. I want to write a small program to simply go in and switch the
trashcan icon for a single bit icon, and of course switch it back again. What I
need to know is will it cause any unpleasant side effects on any of the macs
from a Mac Plus forward to the new models? Oh, and if I'm all wet, is there a
better way to accomplish this? My freind doesn't want to have to deal
constantly with ResEdit. He fears being too distracted to do a careful enough
job. I've seen the kids. I don't blame him. Thanks for the input.

                             internet: jhenk@hmcvax.claremont.edu
                               bitnet: jhenk@hmcvax

cs483106@umbc5.umbc.edu (cs483106) (05/08/91)

I don't think your strategy of swapping the trash can icon for a 1 pixel icon
will work(at least, not well). The problem is that you can also drag things to
the NAME of the trash can and they will still go into the trash. Also,
trying to access the finder's resource fork while multi-finder is running
isn't going to be easy(i.e. the resource manager isn't going to do it for you)

Might I suggest an alternative strategy? Get a macro program (or whatever) and
create a macro that drags the trash off the screen. Perhaps you could create 
the macro with stepping out running, and then use it without stepping out. Of
course, you'd also need a macro to drag it back on, and the kids may eventually
figure out where your macro is, but other than that...

(BTW, I've no connection with whoever makes Stepping Out, except that I think
it's a neat product, and I wish I could afford to buy it)

"Pope" Q.E.D
Michael Kohne
mikek@isis.ngs.noaa.gov

davids@mondo.engin.umich.edu (David Snearline) (05/08/91)

An alternative method to disabling the trash can would be to "soft lock"
the hard disk volume.  This entails setting bit 15 of the volume attrbiutes
flag and requires direct disk driver calls.  (Or at least to unset the
flag.)  This is fairly equivalent to placing a big write protect switch
on the drive.

There are drawbacks to this approach though.  First, it does mean that
nothing can be deleted at all until you "unlock" the volume.  Second,
certain applications and desk accessories choke on a write protected
boot volume.  The Chooser DA is a good example of this.  So this is more
of a last resort method.

--- Dave ---


--
David Snearline
CAEN Network Operations
University of Michigan Engineering

drenze@umaxc.weeg.uiowa.edu (Douglas Renze) (05/08/91)

Here's a possibility:  I believe that there's an FKEY on the sumex archives that
disables the Finder's ability to delete stuff from the Trash.  I know it works
with System 6.0.x (if that's where I got it from), but I have no idea whether
it works with System 7.  This might be a workable solution to your problem.

--
Douglas J Renze                      internet:  drenze@umaxc.weeg.uiowa.edu
                                       delphi:  drenze

brad@aero.org (Bradley A. West) (05/09/91)

In article <1991May8.163306.17667@engin.umich.edu> davids@mondo.engin.umich.edu (David Snearline) writes:
>An alternative method to disabling the trash can would be to "soft lock"
>the hard disk volume.  This entails setting bit 15 of the volume attrbiutes
>flag and requires direct disk driver calls.  (Or at least to unset the
>flag.)  This is fairly equivalent to placing a big write protect switch
>on the drive.
>
>There are drawbacks to this approach though.  First, it does mean that
>nothing can be deleted at all until you "unlock" the volume.  Second,
>certain applications and desk accessories choke on a write protected
>boot volume.  The Chooser DA is a good example of this.  So this is more
>of a last resort method.

Just in case anyone's interested in doing this, I wrote a utility called
FloppyUnlocker that does this.  It's available free from sumex and works
quite nicely!  It locks & unlocks floppies readily, but doesn't seem
to lock hard disks; although it does.  For the reasons mentioned
above, I made it more difficult. To lock hard disks, type the
following key sequence:
	 <caps-lock(engaged)><shift><option><command><"L">
not a likely combination to be accidently hit!
Just be sure to unlock the disk before you want to do any real work.

Brad

mrd@runx.oz.au (Malcolm Davidson) (05/09/91)

In article <1991May8.014221.1@hmcvax.claremont.edu> jhenk@hmcvax.claremont.edu writes:
>
>   Hello. A freind of mine is teaching a class (second grade) and is using the
>Mac as a teaching tool. Everything is fine except that the kids have discovered
>the trash can to be a wonderful toy for dragging files to. Wonderful. Instead

Try using the TrashDisable Init which I wrote to stop my 4 year old
daughter from trashing everying possible like she did once before. I
posted it to comp.mac.binaries a couple of months ago. With TrashDisable
installed, it is impossible to delete files from the finder or from any DA
installed in the finders application heap unless to toggle the INIT off with
the supplied FKey. Using the FKey a second time enables the INIT once again.
TrashDisable does not interfere with the ability of other applications (or DAs
not installed in the Finders heap) to delete files.