X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Andrew Schulman Subject: Re: Feature request: rm to recycle bin Date: Mon, 12 May 2008 10:53:24 -0400 Lines: 16 Message-ID: References: <48258BCC DOT 9090905 AT sdkennedy DOT com> <20080510195121 DOT GM18799 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive: encrypt X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com > > Given that the code for sending to recycyle bin is already in place, may I > > request that a command line option be added to rm and rmdir to send all > > files to the bin? This would be extremely handy for use in scripts, to me > > at the very least. > > The code to move files into the bin is an underlying, hidden feature of > the unlink(2), rmdir(2) and rename(2) POSIX calls. The rm(1) tool has > no access to this functionality and there's no intention to add a > non-POSIX API to allow any tool to use it. There is a library called libtrash that implements a trash can for GNU/Linux by intercepting the above calls: http://pages.stern.nyu.edu/~marriaga/software/libtrash/ . No one has packaged it for Cygwin. It requires the use of LD_PRELOAD, which I believe is supposed to work in Cygwin, although I've never tried to use it. Hm... might be interesting to try... I'll look at it. A. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/