home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.human-factors
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!saturn.cs.umn.edu!konstan
- From: konstan@saturn.cs.umn.edu (Joe Konstan)
- Subject: Solving the Unix rm problem, and others as well
- Message-ID: <1992Nov18.182540.950@news2.cis.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: saturn.cs.umn.edu
- Organization: Department of Computer Science, University of Minnesota
- Date: Wed, 18 Nov 1992 18:25:40 GMT
- Lines: 40
-
- Now that I finally have enough disk space to do so, I adapted Donald Norman's
- rotating wastebaskets approach to cover rm as well as several other types of
- files that I might need in the short term, but likely will not and certainly
- won't in the long term.
-
- I have seven directories, .waste0 through .waste6, and rm is aliases to move
- the item to .waste0. So far, I haven't worried about name conflicts, though
- I imagine I may put in code to handle that later. Early each morning, the
- waste directories churn, cleaning out the week-old trash and creating a new
- clean .waste0 for the next day. If disk space becomes tight, I can churn
- manually, or just really delete items selectively.
-
- The side benefit is that I can create a whole bunch of temp files in .waste0.
-
- For instance, I have all outgoing mail saved there. Important mail is saved
- elsewhere, too, but this way I never need worry about hearing that the mail
- was accidentally deleted and discovering that I don't have an original. Seven
- days seems like enough to cover almost any such circumstance. Similarly, I
- put other temporary work which is likely to not be needed, but which I want to
- have a chance of recovering for a while, in .waste0. I do this with output
- logs that are overwritten in place. Once I've checked the new log, I can
- ignore the old one, but this way I have the old one available just-in-case.
-
- Of course, this is a workaround (and a hack at that) to the real problem that
- Unix doesn't have much of a way to help prevent these disasters (rm *).
- Coming from the lisp world, it seems to me that one answer would be to have
- "Macro" programs that automatically are invoked with an un"globbed" command
- line. (I recognize that this would require a lot of major changes. It is
- only a design idea.) In this way, rm and similar programs would be able to
- tell that they were being called with suspicious-looking inputs and react
- accordingly (for instance, being called with * and a file name
- a path is very likely to be an accidental added space). Users could also
- set up rm-defaults to specify when prompting should be done.
-
- I know tcsh has some inroads along this path. File completion is programmable
- by command (so rm can prefer .o to .c, but cc will prefer .c). Maybe this
- is the direction to go.
-
- Joe Konstan
- konstan@cs.umn.edu
-