From owner-freebsd-chat Thu Jan 23 18:15:37 2003 Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B6E837B401 for ; Thu, 23 Jan 2003 18:15:36 -0800 (PST) Received: from excalibur.skynet.be (excalibur.skynet.be [195.238.3.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF2E043F3F for ; Thu, 23 Jan 2003 18:15:34 -0800 (PST) (envelope-from brad.knowles@skynet.be) Received: from [10.0.1.2] (ip-26.shub-internet.org [194.78.144.26] (may be forged)) by excalibur.skynet.be (8.11.6/8.11.6/Skynet-OUT-2.20) with ESMTP id h0O2FJZ15561; Fri, 24 Jan 2003 03:15:19 +0100 (MET) (envelope-from ) Mime-Version: 1.0 X-Sender: bs663385@pop.skynet.be Message-Id: In-Reply-To: <200301241134.31376.jrhoden@unimelb.edu.au> References: <200301232258.h0NMwlaX006708@grimreaper.grondar.org> <200301241004.46881.jrhoden@unimelb.edu.au> <200301241134.31376.jrhoden@unimelb.edu.au> X-Grok: +++ath X-WebTV-Stationery: Standard; BGColor=black; TextColor=black Reply-By: Wed, 1 Jan 1984 12:34:56 +0100 Date: Fri, 24 Jan 2003 03:14:40 +0100 To: JacobRhoden From: Brad Knowles Subject: Re: recover overwritten file Cc: freebsd-chat@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org At 11:34 AM +1100 2003/01/24, JacobRhoden wrote: > Heres a thought, a modification to the 'rm' command, whereby if a certian > environment variable was set (ie TRASH_DIRECTORY or something) then rm would > do a move instead of a unlink. A flag could be added to rm to force delete > (when the environment variable is being used)... what woudl be the chances of > something like that getting committed? The problem comes in the details. I wrote a shell script like this many, many years ago (1986?). However, what do you do when you get two files with the same name? And how do you properly un-rm them -- how do you know where to restore the file to? One idea would be to check things into CVS, but then what do you do about binaries? How do you deal with massive recursive removals? Myself, I found that the biggest problem was that this doesn't solve the whole problem -- sure, I could cover rm, but that didn't help me when I mv'ed one file onto another, and I lost two weeks worth of work on a class project. When I protected both mv and rm, that didn't help me when I accidentally redirected the output of a program onto a file I had wanted to keep. Basically, I got used to having these around these crutches, and then I really seriously hurt myself when they suddenly didn't provide coverage for the specific type of foot-shooting that I was engaging in. -- Brad Knowles, "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, Historical Review of Pennsylvania. GCS/IT d+(-) s:+(++)>: a C++(+++)$ UMBSHI++++$ P+>++ L+ !E-(---) W+++(--) N+ !w--- O- M++ V PS++(+++) PE- Y+(++) PGP>+++ t+(+++) 5++(+++) X++(+++) R+(+++) tv+(+++) b+(++++) DI+(++++) D+(++) G+(++++) e++>++++ h--- r---(+++)* z(+++) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message