From owner-freebsd-questions Wed May 16 21:24: 4 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 77A0B37B422 for ; Wed, 16 May 2001 21:24:01 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 96998 invoked by uid 100); 17 May 2001 04:23:59 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15107.21087.162859.867127@guru.mired.org> Date: Wed, 16 May 2001 23:23:59 -0500 To: Duke Normandin <01031149@3web.net> Cc: questions@freebsd.org Subject: Re: Recycle bin for FreeBSD? :-) In-Reply-To: <20010516191247.C167439@mandy.rockingd.calgary.ab.ca> References: <132922586@toto.iv> <15106.60293.141053.55469@guru.mired.org> <20010516191247.C167439@mandy.rockingd.calgary.ab.ca> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Duke Normandin <01031149@3web.net> types: > On Wed, May 16, 2001 at 04:05:09PM -0500, Mike Meyer wrote: > > Duke Normandin <01031149@3web.net> types: > > > Try the attached scripts. I hope that this is close to what you were > > > looking for. Later.... > > Someone really should do these things *right* and put them in a port. > > To see what's wrong with Duke's script, consider the following sequence: > These are NOT Duke's script, as Mike suggests! They are taken from > pg 186-187 of "Voodoo Unix" by Charles Russel and Sharon Crawford. The > authors encouraged their use with no conditions. My apologies. Since you posted them without attribution, I assumed you had authored them. > > $ rm My_Precious_File > > > > $ cd old > > $ rm My_Precious_File > > And you can no longer recover the current version of > > My_Precious_File. If you do this on Windows, you wind up with two > > copies of My_Precious_File, and it's not obvious which is which. > I wonder if Mike would be so kind as to suggest a remedy for the issue > that he's brought forward. Would appending a unique suffix to the > filename in the 'mv' to the ~/tmp process help? Something like that would mimic the Windows behavior - but I don't like that one either. Other solutions include recreating the diretory tree in the trashcan directory. If you copy everything they delete anywhere, you can wind up creating directories with nothing in them but one directory. If you restrict it to things that are removed in their home directory - which solution I've seen - well, you'll have people wondering why the can't recover things they deleted in /tmp. Yet another approach is to give up on having a single global trashcan, and have one in every directory. For this case, you have to be careful of security issues in globally writable directories. While we're at it, the $* in the first script should be "$@". http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message