Re: Move to Windows Recycle Bin instead of deleting
Ralf Hauser wrote: Is there a way to have the files moved to the windows recycle bin from the cygwin shell window/command line? Hi! You can use the freeware Delete XP http://www.easytools.com/Downloads/Freebies/ which behaves like the standard (MS) del - but deletes to the recycle bin. I use it for years (it was formerly known as Delete 97) without problems. Cheers Tino -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Move to Windows Recycle Bin instead of deleting
On Tue, 14 Jan 2003, Ralf Hauser wrote: Is there a way to have the files moved to the windows recycle bin from the cygwin shell window/command line? Yes. In your ~/.bashrc: RECYCLE_BIN_PATH=location of your recycle bin function rm() { mv $@ $RECYCLE_BIN_PATH } The one gotcha of the above is that mv will get the options passed to rm - not sure if there are any discrepancies. However, if you stick to rm -r and rm -f, you should be fine. The procedure for finding the location of the recycle bin depends on your operating system and your setup. On my Win2k machine, I can simply use RECYCLE_BIN_PATH=/cygdrive/c/RECYCLER/`ls -t /cygdrive/c/RECYCLER|head -1` Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_[EMAIL PROTECTED] |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk! -- /usr/games/fortune -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: Move to Windows Recycle Bin instead of deleting
-Original Message- From: Igor Pechtchanski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 14, 2003 4:06 PM To: Ralf Hauser Cc: [EMAIL PROTECTED] Subject: Re: Move to Windows Recycle Bin instead of deleting On Tue, 14 Jan 2003, Ralf Hauser wrote: Is there a way to have the files moved to the windows recycle bin from the cygwin shell window/command line? Yes. In your ~/.bashrc: RECYCLE_BIN_PATH=location of your recycle bin function rm() { mv $@ $RECYCLE_BIN_PATH } I would speculate that another problem with this is that if you view the recycling bin in explorer, then you will no see (or be able to restore) the cygwin files. Also, if you empty the bin using explorer, then you will likely leave all cygwin-moved files. -Rolf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: Move to Windows Recycle Bin instead of deleting
On Tue, 14 Jan 2003 20:42:45 +0100, you wrote: Is there a way to have the files moved to the windows recycle bin from the cygwin shell window/command line? AFAIK, there isn't, although the int SHFileOperation(LPSHFILEOPSTRUCT lpFileOp) function in shell32.dll http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shfileoperation.asp might be useful in working out a way to do it. HTH, CHris -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
RE: Move to Windows Recycle Bin instead of deleting
Ralf, Please keep the discussion on the list so other people have access to this information and opportunity to share their experience. That Reply-To: is there for a reason. It's quite possible that something like this would happen. It makes sense that some sort of versioning is used for the deleted files. There might also be a difference between recycle bins on NTFS and FAT32 filesystems. I should probably have added a disclaimer that the script below is untested, as I, myself, don't use this kind of trick. The next place to look would probably be MSDN (http://msdn.microsoft.com/)... You might even need to resort to using rundll32 and calling a function that erases the file. I'm sorry I can't be of more help. Igor P.S. I don't know Michael Steiner, sorry. On Tue, 14 Jan 2003, Ralf Hauser wrote: Igor, Thanks for the hint. My win2k doesn't know /cygdrive/c/RECYCLER/ but /cygdrive/c/Recycled When just moving to the latter, it gets there and can be seen via cygwin command line ls (I just see the correct extension, but not the filename - it comes like Dc712.html), but when opening the windows recycle bin icon, I don't see it. Doing that ls -t ... | head -1 yields INFO2 to me and that appears to be a binary info file about where the files were deleted from and when. Trying to redo your RECYCLE_BIN_PATH got me slightly into trouble because when I copied a test file to /cygdrive/c/RECYCLER/INFO2 going back to the windows representation of the Recycle bin, all information was wiped and it claims to only contain 0 files while under cygwin's ls, still all the D###.* files are there. Right-mouse-click refresh unfortunately doesn't help. Any thoughts? Ralf P.S.: Don't worry I don't think anything I desperately want to recover was in my recycle bin... P.P.S.: Say hello to Michael Steiner he just started to work at Watson too... -Original Message- From: Igor Pechtchanski [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 14. Januar 2003 22:06 To: Ralf Hauser Cc: [EMAIL PROTECTED] Subject: Re: Move to Windows Recycle Bin instead of deleting On Tue, 14 Jan 2003, Ralf Hauser wrote: Is there a way to have the files moved to the windows recycle bin from the cygwin shell window/command line? Yes. In your ~/.bashrc: RECYCLE_BIN_PATH=location of your recycle bin function rm() { mv $@ $RECYCLE_BIN_PATH } The one gotcha of the above is that mv will get the options passed to rm - not sure if there are any discrepancies. However, if you stick to rm -r and rm -f, you should be fine. The procedure for finding the location of the recycle bin depends on your operating system and your setup. On my Win2k machine, I can simply use RECYCLE_BIN_PATH=/cygdrive/c/RECYCLER/`ls -t /cygdrive/c/RECYCLER|head -1` Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_[EMAIL PROTECTED] ZZZzz /,`.-'`'-. ;-;;,_[EMAIL PROTECTED] |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk! -- /usr/games/fortune -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/