Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!claris!apple!steele
From: steele@Apple.COM (Oliver Steele)
Newsgroups: comp.sys.mac
Subject: Re: No Finder with Multifinder
Message-ID: <12931@apple.Apple.COM>
Date: 28 Jun 88 01:13:56 GMT
References: <1123@aucs.UUCP> <8964@dartvax.Dartmouth.EDU> <4774@hoptoad.uucp>
Reply-To: steele@apple.apple.com.UUCP (Oliver Steele)
Organization: Apple Computer Inc, Cupertino, CA
Lines: 58

earleh@eleazar.dartmouth.edu (Earle R. Horton) notes:
]A word of caution is indicated here:  When you call ExitToShell
]without the knowledge and consent of the running application, then
]said application does not get to do whatever cleanup it needs to do
]when it exits.  With the Finder, this means that if you spend a lot of
]time rearranging your DeskTop, then blast it with an ExitToShell FKEY,
]your DeskTop changes will not get recorded on disk.

tim@hoptoad.UUCP (Tim Maroney) writes:
>But ExitToShell closes all the application's open resource files, and
>closing a resource file to which changes have been made automatically writes
>the changes to disk.

On an HFS system, file and folder positions aren't stored in the Desktop
file.  And neither is information as to which folders are open.  Or
information that a file has been put in the Trash.  And since the Finder
buffers all this information (apparently until a volume is ejected,
although I'm I'm sure it does some stuff more often.  Trash is definitely
emptied more often.), instead of writing it out to disk immediately, all
changes of this nature are lost if the Finder is exited by some other
means than under its own control.

>At least, this is so if you don't bypass the Resource
>Manager and do your own resource file i/o, which some Apple software does.

What software does this? (Besides RezDet, of course.)  Not a challenge; I
just hadn't known this.

>Have you actually seen this happen, or is it speculation?

I've seen it.  Try it.

>Some applications
>(including, if memory serves, the Finder) guaranteed cleanup simply by
>patching their cleanup code into ExitToShell.

All applications compiled with Lightspeed C do this, partly to remove
some other patched traps and partly to give LSC's stdio library a chance
to close files opened with fopen(), since UNIX programs typically don't
bother closing files.

>So it's not completely true to say that using an ExitToShell FKEY will
>prevent the application from cleaning up.  It's just a matter of how much
>work the application developer put into guaranteeing cleanup.

True, but I can count on the fingers of one foot the number of
applications I use that clean up everything after a forced ExitToShell.

>Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim
>"As I was walking among the fires of Hell, delighted with the enjoyments of
> Genius; which to Angels look like torment and insanity.  I collected some of
> their Proverbs..." - Blake, "The Marriage of Heavern and Hell"

 ----------------------------------------------------------------------------
 Oliver Steele						     steele@apple.com
 Apple ATG

 Disclaimer:  This isn't official.  And Mr. Horton, to the best of my
 knowledge, isn't from Chapel Hill.