From owner-freebsd-questions Tue May 15 20:24:20 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id 98C4837B422 for ; Tue, 15 May 2001 20:24:16 -0700 (PDT) (envelope-from ryan@sasknow.com) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id VAA96459; Tue, 15 May 2001 21:24:14 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Tue, 15 May 2001 21:24:14 -0600 (CST) From: Ryan Thompson To: Duke Normandin <01031149@3web.net> Cc: Freebsd Questions Subject: Re: Recycle bin for FreeBSD? :-) In-Reply-To: <20010515140115.A137489@mandy.rockingd.calgary.ab.ca> Message-ID: Organization: SaskNow Technologies [www.sasknow.com] MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Duke! Haven't heard from you in a while! I've actually already got a semi-sophisticated shell script on the go. (It's quite similar to what you sent). I haven't had any time to finish it, so I've just been fishing for "redi-made" solutions ;-) The script incorporates better error checking, moves files with real paths, preserves symlinks, and (when it's done) will implement all of the relevant rm(1) flags properly so aliasing rm will provide compatibility. I'll probably document and make a port out of it when it's done, as it appears there might be a small interest in it, and there really hasn't been much done along these lines. - Ryan Duke Normandin wrote to Ryan Thompson: > On Tue, May 15, 2001 at 09:18:10AM -0600, Ryan Thompson wrote: > > Michael P. Soulier wrote to freebsd-questions@FreeBSD.ORG: > > > > > On Mon, May 14, 2001 at 02:16:24AM +0000, Ryan Thompson wrote: > > > > > > > > [ Don't throw things at me, OK? :-) ] > > > > > > Tempting... :) > > > > No. Don't. :-) > > > > > > Is anyone aware of any simple replacement for rm(1) that mimics the > > > > "trash" or "recycle" features of other OSes (i.e., moves the files to a > > > > safe area under the users control). > > > > > > 1. Don't delete things you want to keep. :) > > > > OK, YOU tell 'em. :-) > > > > > > > 2. > > > > > > TRASH='/pub/trashfolder' > > > function rm { > > > mv $* $TRASH || echo "Failed to move to trash" > > > } > > > > > > Or something along those lines. > > > > Yeah, already whipped up something like that. My question is whether to > > finish it, or find an existing one that works just as well. > > Try the attached scripts. I hope that this is close to what you were > looking for. Later.... > -- Ryan Thompson Network Administrator, Accounts SaskNow Technologies - http://www.sasknow.com #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2 Tel: 306-664-3600 Fax: 306-664-1161 Saskatoon Toll-Free: 877-727-5669 (877-SASKNOW) North America To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message