X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org X-IronPortListener: Outbound_SMTP Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Feature request: rm to recycle bin Date: Wed, 14 May 2008 08:18:40 -0400 Message-ID: <31DDB7BE4BF41D4888D41709C476B6570929AF35@NIHCESMLBX5.nih.gov> In-Reply-To: <48258BCC.9090905@sdkennedy.com> References: <48258BCC DOT 9090905 AT sdkennedy DOT com> From: "Buchbinder, Barry (NIH/NIAID) [E]" To: , X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m4ECJFnl028335 Stephen Kennedy wrote on Saturday, May 10, 2008 7:50 AM: > I've searched the mailing list so believe this isn't a FAQ; apologies > if it is. > > There have been several threads on the mailing list about replicating > Windows' recycle bin functionality using aliases or shell functions, > none of which are really satisfactory. However, in this thread > http://sourceware.org/ml/cygwin/2007-01/msg00327.html it was > discussed that 'rm' has been patched to send deleted files to the > recycle bin in certain limited circumstances. > > Given that the code for sending to recycle 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. > > While I'm here please let me thank you very much for providing such an > *awesome* set of tools. > > Steve What you might consider is finding a Windows command line utility that does what you want and put a cygwin wrapper around it. One that I know of can be found here: . NOTE: I do not actually use , so this is a suggestion, not a recommendation. Note also that this utility is GPLed (ver. 2). This wrapper should work. (Again, not tested.) I make no representation that it is bug-free. #!/bin/sh if [ "$1" = '--help' -o $# = 0 ] then echo Usage: $(realpath "$0") [OPTION]... FILE... echo Send the FILE(s) to the Windows Recycle Bin. echo ' -i prompt before every removal' echo ' --help display this help and exit' exit fi FORCE='-f' if [ "$1" = '-i' ] then FORCE='' shift fi for F in $@ do if [ -f "$F" ] then path/recycle ${FORCE} "$(cygpath -w "$F")" else echo $(basename "$0": \`$F\' not found. fi done -- 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/