Subject: Re: sending deleted files to recycle bin from dired

From: "Laurence C. Brevard" <[email-masked]>
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             [email-masked]
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