This is the mail archive of the
mailing list for the Cygwin project.
Re: Feature request: rm to recycle bin
> > 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