home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / humanfa / 2665 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.8 KB  |  52 lines

  1. Newsgroups: comp.human-factors
  2. 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
  3. From: konstan@saturn.cs.umn.edu (Joe Konstan)
  4. Subject: Solving the Unix rm problem, and others as well
  5. Message-ID: <1992Nov18.182540.950@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: saturn.cs.umn.edu
  8. Organization: Department of Computer Science, University of Minnesota
  9. Date: Wed, 18 Nov 1992 18:25:40 GMT
  10. Lines: 40
  11.  
  12. Now that I finally have enough disk space to do so, I adapted Donald Norman's
  13. rotating wastebaskets approach to cover rm as well as several other types of
  14. files that I might need in the short term, but likely will not and certainly 
  15. won't in the long term.
  16.  
  17. I have seven directories, .waste0 through .waste6, and rm is aliases to move
  18. the item to .waste0.  So far, I haven't worried about name conflicts, though
  19. I imagine I may put in code to handle that later.  Early each morning, the 
  20. waste directories churn, cleaning out the week-old trash and creating a new
  21. clean .waste0 for the next day.  If disk space becomes tight, I can churn
  22. manually, or just really delete items selectively.
  23.  
  24. The side benefit is that I can create a whole bunch of temp files in .waste0.
  25.  
  26. For instance, I have all outgoing mail saved there.  Important mail is saved
  27. elsewhere, too, but this way I never need worry about hearing that the mail
  28. was accidentally deleted and discovering that I don't have an original.  Seven
  29. days seems like enough to cover almost any such circumstance.  Similarly, I
  30. put other temporary work which is likely to not be needed, but which I want to
  31. have a chance of recovering for a while, in .waste0.  I do this with output
  32. logs that are overwritten in place.  Once I've checked the new log, I can 
  33. ignore the old one, but this way I have the old one available just-in-case.
  34.  
  35. Of course, this is a workaround (and a hack at that) to the real problem that
  36. Unix doesn't have much of a way to help prevent these disasters (rm *).  
  37. Coming from the lisp world, it seems to me that one answer would be to have
  38. "Macro" programs that automatically are invoked with an un"globbed" command
  39. line.  (I recognize that this would require a lot of major changes.  It is
  40. only a design idea.)  In this way, rm and similar programs would be able to
  41. tell that they were being called with suspicious-looking inputs and react
  42. accordingly (for instance, being called with * and a file name 
  43. a path is very likely to be an accidental added space).  Users could also
  44. set up rm-defaults to specify when prompting should be done. 
  45.  
  46. I know tcsh has some inroads along this path.  File completion is programmable
  47. by command (so rm can prefer .o to .c, but cc will prefer .c).  Maybe this
  48. is the direction to go.
  49.  
  50. Joe Konstan
  51. konstan@cs.umn.edu
  52.