From owner-ntemacs-users@june  Tue Jan 21 06:13:07 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "21" "January" "1997" "08:11:00" "-0500" "RAY RIZZUTO" "RAY.RIZZUTO@gsnetworks.gensig.com" nil "10" "sending deleted files to recycle bin from dired" "^From:" nil nil "1" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id GAA06377 for <voelker@june.cs.washington.edu>; Tue, 21 Jan 1997 06:13:06 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id GAA29649 for <voelker@joker.cs.washington.edu>; Tue, 21 Jan 1997 06:13:05 -0800
Received: from server.gensig.com (server.gensig.com [204.242.12.50]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with ESMTP id FAA04850 for <ntemacs-users@cs.washington.edu>; Tue, 21 Jan 1997 05:33:28 -0800
Received: by server.gensig.com; id IAA12452; Tue, 21 Jan 1997 08:18:22 -0500 (EST)
Received: from unknown(136.248.210.71) by server.gensig.com via smap (3.2) 	id xmab12433; Tue, 21 Jan 97 08:18:04 -0500
Received: from ccMail by smtpgss.gensig.com   (IMA Internet Exchange 2.0 Enterprise) id 2E4C4EE0; Tue, 21 Jan 97 08:30:22 -0500
Mime-Version: 1.0
Message-ID: <2E4C4EE0.1645@gsnetworks.gensig.com>
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Description: cc:Mail note part
From: RAY.RIZZUTO@gsnetworks.gensig.com
To: ntemacs-users@cs.washington.edu
Subject: sending deleted files to recycle bin from dired
Date: Tue, 21 Jan 1997 08:11:00 -0500


     I'm not sure if this is an Emacs question or a Windows 95 question.  I 
     was wondering if it is possible to get the dired mode to send deleted 
     files to the recycle bin instead of permanently deleting them.  I've 
     been burnt a few times with needing to undelete files erroneously 
     deleted that didn't go to the recycle bin.  

     It's a shame Microsoft didn't make the default deletion behavior to 
     send files to the recycle bin!  Or at least a user-configurable 
     option!

From owner-ntemacs-users@june  Tue Jan 21 09:40:13 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "21" "January" "1997" "11:55:00" "-0500" "Peter Breton" "pbreton@volte.i-kinetics.com" nil "31" "sending deleted files to recycle bin from dired" "^From:" nil nil "1" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id JAA19193 for <voelker@june.cs.washington.edu>; Tue, 21 Jan 1997 09:40:13 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id JAA25639 for <voelker@joker.cs.washington.edu>; Tue, 21 Jan 1997 09:40:11 -0800
Received: from ns.i-kinetics.com (ns.i-kinetics.com [205.181.32.10]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id IAA15333 for <ntemacs-users@cs.washington.edu>; Tue, 21 Jan 1997 08:58:18 -0800
Received: from i-kinetics.com (dirac.i-kinetics.com [192.31.81.157]) by ns.i-kinetics.com (8.6.12/8.6.9) with SMTP id LAA20432; Tue, 21 Jan 1997 11:50:51 -0500
Received: from volte.i-kinetics.com by i-kinetics.com (4.1/SMI-4.1/UUNET) 	id AA20375; Tue, 21 Jan 97 11:55:35 EST
Received: by volte.i-kinetics.com (SMI-8.6/SMI-SVR4) 	id LAA08788; Tue, 21 Jan 1997 11:55:00 -0500
Message-Id: <199701211655.LAA08788@volte.i-kinetics.com>
In-Reply-To: <2E4C4EE0.1645@gsnetworks.gensig.com>
References: <2E4C4EE0.1645@gsnetworks.gensig.com>
Reply-To: pbreton@i-kinetics.com
From: Peter Breton <pbreton@volte.i-kinetics.com>
To: RAY.RIZZUTO@gsnetworks.gensig.com
Cc: ntemacs-users@cs.washington.edu
Subject: sending deleted files to recycle bin from dired
Date: Tue, 21 Jan 1997 11:55:00 -0500


 RAY>      I'm not sure if this is an Emacs question or a Windows 95
 RAY> question.  I was wondering if it is possible to get the dired
 RAY> mode to send deleted files to the recycle bin instead of
 RAY> permanently deleting them.  I've been burnt a few times with
 RAY> needing to undelete files erroneously deleted that didn't go to
 RAY> the recycle bin.

You could simply write your own function that does this. However, I
would guess that dragging files to the recycle bin does more than
simply move them to a different directory (eg, I would think that it
has to remember where they were originally located), and I'm not sure
how you would do that.

This is an interesting issue too, as one could write an Emacs package
that provided "undelete" functionality and would work across all
platforms (in fact, you might look to see if someone has already done
just that). But I doubt that this would be integrated with the
Recycle Bin, or the Mac trash can, or whatever.

 RAY>      It's a shame Microsoft didn't make the default deletion
 RAY> behavior to send files to the recycle bin!  Or at least a
 RAY> user-configurable option!

I believe Emacs deletes files (eg, with delete-file) by calling the
corresponding Win32 API function, whereas the "drag-n-drop to recycle
bin" is done with Explorer's Shell extensions. So these are different
critters. I am not by any means a Win32 expert, though, so if anyone
knows better, please correct me.

			Peter

From owner-ntemacs-users@june  Tue Jan 21 10:04:11 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "21" "January" "1997" "12:29:01" "+0000" "Jonathan Arnold" "jdarnold@world.std.com" nil "18" "Re: sending deleted files to recycle bin from dired" "^From:" nil nil "1" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id KAA21257 for <voelker@june.cs.washington.edu>; Tue, 21 Jan 1997 10:04:10 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA29531 for <voelker@joker.cs.washington.edu>; Tue, 21 Jan 1997 10:04:05 -0800
Received: from europe.std.com (europe.std.com [199.172.62.20]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with ESMTP id JAA17896 for <ntemacs-users@cs.washington.edu>; Tue, 21 Jan 1997 09:29:13 -0800
Received: from world.std.com by europe.std.com (8.7.5/BZS-8-1.0) 	id MAA14391; Tue, 21 Jan 1997 12:29:11 -0500 (EST)
Received: from max (world.std.com) by world.std.com (5.65c/Spike-2.0) 	id AA12540; Tue, 21 Jan 1997 12:29:08 -0500
Message-Id: <32E4B68D.3D15@world.std.com>
Reply-To: jdarnold@world.std.com
Organization: Roger Wagner Publishing
X-Mailer: Mozilla 3.0Gold (Win95; I)
Mime-Version: 1.0
References: <2E4C4EE0.1645@gsnetworks.gensig.com> <199701211655.LAA08788@volte.i-kinetics.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Jonathan Arnold <jdarnold@world.std.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: sending deleted files to recycle bin from dired
Date: Tue, 21 Jan 1997 12:29:01 +0000

>  RAY>      It's a shame Microsoft didn't make the default deletion
>  RAY> behavior to send files to the recycle bin!  Or at least a
>  RAY> user-configurable option!
> 
> I believe Emacs deletes files (eg, with delete-file) by calling the
> corresponding Win32 API function, whereas the "drag-n-drop to recycle
> bin" is done with Explorer's Shell extensions. So these are different

I haven't checked it out, but one thing that Norton Recycle, from the
Norton utilities, adds is that files deleted from the command line are
put into the recycling bin.  I'll bet the same would be true for files
deleted from Emacs.

+===================================================+
| Jonathan Arnold (mailto:jdarnold@world.std.com)   |
| Programmer, Roger Wagner Publishing's HyperStudio |
| http://world.std.com/~jdarnold  CIS: 72762,1272   |
+===================================================+

From owner-ntemacs-users@june  Tue Jan 21 13:43:31 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "21" "January" "1997" "14:54:44" "-0600" "Laurence C. Brevard" "Laurence@brevardandbrevard.com" nil "58" "Re: sending deleted files to recycle bin from dired" "^From:" nil nil "1" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id NAA15521 for <voelker@june.cs.washington.edu>; Tue, 21 Jan 1997 13:43:30 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA25663 for <voelker@joker.cs.washington.edu>; Tue, 21 Jan 1997 13:43:26 -0800
Received: from oak.zilker.net (oak.zilker.net [198.252.182.129]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with ESMTP id MAA10558 for <ntemacs-users@cs.washington.edu>; Tue, 21 Jan 1997 12:54:56 -0800
Received: from www by oak.zilker.net (8.8.3/zilker.1.119) 	id OAA23861; Tue, 21 Jan 1997 14:58:32 -0600 (CST)
Message-Id: <3.0.32.19970121145440.009b99d0@mail.zilker.net>
X-Sender: brevard@mail.zilker.net
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: "Laurence C. Brevard" <Laurence@BrevardAndBrevard.com>
To: pbreton@i-kinetics.com
Cc: ntemacs-users@cs.washington.edu
Subject: Re: sending deleted files to recycle bin from dired
Date: Tue, 21 Jan 1997 14:54:44 -0600

At 01:11 PM 1/21/97 -0500, you wrote:
>...I'm freely speculating here, but I'd bet that Norton
>provides its own DEL.EXE executable, which precedes the default one
>on the PATH, and which does the Recycle Bin thing.

NOT! There is no DEL.EXE

DEL (also known as ERASE) are BUILT-IN commands in COMMAND.COM (since
MS-DOS 1.0 through MS-DOS 7.0 aka Win95/DOS part) and in CMD.EXE (Windows
NT since version 3.1 through 4.)

This is also true with the 4DOS.COM shell (and the Norton NDOS.COM that was
derived from it for Norton 6.0-8.0 but NOT Win95).

Using DEL (or ERASE) from the command line does NOT put files in the
recycle bin in Windows 95 or NT .40.

Doing File Delete or hitting the Delete key in Explorer windows in Win95 or
NT 4.0 sends files to the recycle bin by default. Holding the Ctrl key down
while doing it makes them get really deleted.

I don't know exactly how the Norton Utilities for Windows 95 works to catch
other files but I believe it is a combination of replacing some system DLLs
and the old fashioned undelete technique of showing the deleted directory
entries with the first character missing and which may or may not be
successfully recovered.

For Emacs to delete to the recycle bin it would be necessary to call the
appropriate API function for delete. I believe there is a shell extension
DLLs with the necessary function.

I had a quick look in my MS VC++ and MSDN stuff. Searching for recycle I
got this information:

   The SHFileOperation function supports deletion using the Recycle Bin
   interface. For more information about this function, see the documentation
   included in the Win32 SDK.

Looking in there I find:

   There is a structure SHFILEOPSTRUCT that controls this function. A flag

       FOF_ALLOWUNDO  Preserves undo information, if possible.

This applies to NT or 95 but not Win32s (on top of Win3.1).

---
On NT there is a Posix compatibility unlink() function that has nothing to
do with the recycle bin.

There are presumably older functions too that don't use recycle.


LAURENCE C. BREVARD
---------------------------------------------------------------------------
http://www.BrevardAndBrevard.com             Laurence@BrevardAndBrevard.com
BREVARD & BREVARD, Inc.              MOBILE:512-917-1306 PAGER:800-505-8489
7512 Stonecliff Circle, Austin,TX 78731 FAX:512-343-2965 VOICE:512-343-2723

From owner-ntemacs-users@trout  Wed Apr 16 17:15:21 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "16" "April" "1997" "19:34:51" "-0400" "Christopher Stacy" "cstacy@pilgrim.com" nil "22" "feature request: sending deleted files to recycle bin from dired" "^From:" nil nil "4" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id RAA09478 for <voelker@june.cs.washington.edu>; Wed, 16 Apr 1997 17:15:21 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id RAA32068 for <voelker@joker.cs.washington.edu>; Wed, 16 Apr 1997 17:15:20 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id QAA23725 for <ntemacs-users@trout.cs.washington.edu>; Wed, 16 Apr 1997 16:36:31 -0700 (PDT)
Received: from I1.pilgrim.com (i1.pilgrim.com [206.3.211.10]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id QAA06131 for <ntemacs-users@cs.washington.edu>; Wed, 16 Apr 1997 16:36:29 -0700
Received: from CSDESK.pilgrim.com (csdesk [206.3.211.31]) by I1.pilgrim.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via SMTP id TAA21751 for <ntemacs-users@cs.washington.edu>; Wed, 16 Apr 1997 19:34:51 -0400
Message-Id: <199704162334.TAA21751@I1.pilgrim.com>
From: Christopher Stacy <cstacy@pilgrim.com>
To: ntemacs-users@cs.washington.edu
Subject: feature request: sending deleted files to recycle bin from dired
Date: Wed, 16 Apr 1997 19:34:51 -0400

Back in January, Laurence Brevard identified a function in the Win32 SDK
called SHFileOperation that supports deleting to the Recycle Bin; you use
the FOF_ALLOWUNDO flag in the SHFILEOPSTRUCT structure.

It'd be really spiffy if someone would hack some way to call this in fileio.c.  
Maybe "delete-file" should #ifdef WINDOWSNT obey the variable
"delete-uses-recycle-bin" and call the function "recycle-file",
which does the SHFileOperation.  This would also allow users to write
handlers that called "recycle-file" themselves, if needed.

(The normal "delete-file" can safely call the recycle function even on
NFS mounted files: I just tried it in the Explorer, and it knows what's
going on and confirms, "Really delete this file?")

I guess we would also want a (m-x) empty-recycle-bin function;
probably just some other bits in a SHFILEOPSTRUCT packet.

(If I had a Win32 development environment and a clue, I'd do the
work myself.  But all I have on here is EMACS, so I'll just recursively
throw myself on the mercy of Geoff and Andrew.  THANKS!)

Chris

