Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2001 23:23:59 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Duke Normandin <01031149@3web.net>
Cc:        questions@freebsd.org
Subject:   Re: Recycle bin for FreeBSD? :-)
Message-ID:  <15107.21087.162859.867127@guru.mired.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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
> > <realize you weren't where you thought you were, so...>
> > $ 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 "$@".

	<mike
--
Mike Meyer <mwm@mired.org>			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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15107.21087.162859.867127>