[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Ading a wastebasket

*- Michael Meskes wrote about "Ading a wastebasket"
| Since I happen to remove files I still need quite often I'm thinking about
| adding a feature that only moves the file out of the way, but still keeps
| them on the machine.
| There is only one such mechanism I know of, namely the delete program as rm
| replacement from the MIT Athena project. But for several reasons I don't
| really like it. Most importantly of course it is not really rm compatible.
| But also because it cannot prevent you from removing files from an
| application.
| So I wonder whether these is a package taking care of this. Otherwise I
| might consider writing one. My idea would be to create a library that
| overloads the unlink() call. I wonder if others would be interested in this
| too.
| Michael

Take a look at the entomb package that was written at Purdue

The only archive of it I could find was from comp.source.3b1 archives at
in shell archive form.

A snippet of the man page for the libtomb.a library says this.

     libtomb, creat, open, rename, truncate, unlink - subroutines
     to entomb a file
     The  entombing  library,  libtomb.a(3x),  contains  routines
     named  creat,  open,  rename,  truncate, and unlink that are
     call-compatible with the system calls of the same names, but
     which  as a side effect may execute /usr/local/lib/entomb to
     arrange for the file in question to be entombed.

     The user may specify which files should be entombed based on
     file  name.   To  do  so,  one must introduce a list of file
     names  and/or  glob  patterns  to  the  system  through  the
     environment  variable  named ENTOMB.  ENTOMB will default to
     an internal setting if it  is  not  defined  in  the  user's
     Matthew Bradburn, Purdue University Computing Center

>From the entomb man page,

     entomb - entomb files
     Entomb(8L) saves files that are otherwise destroyed by  com-
     mands  such as rm(1), mv(1), and cp(1), in effort to provide
     for user level file recovery.  When a user takes action that
     would  destroy  the  contents  of  a  file, entomb creates a
     back-up of the file and places  the  back-up  in  a  special
     directory called a "tomb."

     Normally, entomb moves files to the tomb  with  link(2)  and
     removes  them  from  the  current  directory with unlink(2).
     However, it is often times desirable to copy a file  to  the
     tomb  instead  of  using  link  and unlink.  While generally
     slower, the copy options to entomb have the  advantage  that

     Matthew Bradburn
     Greg Becker, becker@clam.com
     Kevin Braunsdorf, ksb@cc.purdue.edu
     PUCC Unix Group

I am not affiliated with the authors in any way except that the
software runs on all the Solaris servers at Purdue and I have been
saved by it a few times.

"Never criticize anybody until you have walked a mile in their shoes,  
 because by that time you will be a mile away and have their shoes." 
							   - unknown  

Mechanical Engineering                              servis@purdue.edu
Purdue University                   http://www.ecn.purdue.edu/~servis

Reply to: