[comp.sys.mac.misc] Locked folders under Multifinder

barvian@ece.cmu.edu (Scott Barvian) (05/02/91)

I have been having a problem that is similar to the "Folder From Hell"
problem.  The best way to describe it is with an example:

Suppose I download a program that, after unstuffing, puts the application/init
or whatever and a TeachText doc file in its own folder.  I then open the
doc file, browse it, close the file (but not quit TeachText) and decide to
trash the whole folder.  When I try to empty the trash, I get the message

The Trash couldn't be emptied (a file was busy or a folder was not empty).

and the (now empty folder) reappears.  Repeated attempts to trash the folder
do no good.

I can't delete the folder until after I quit TeachText.  So it looks like the
application "locks" the folder somehow.

So, I trained myself to always Quit TeachText whenever I use it.  But another
joy of Multifinder is to keep DAs open in the background, which I've started
to do lately.  I find that I have the "locked folder" problem until I quit
all DA's (even if a DA had nothing to do with the folder/file).

Hopefully this is a long question with a short answer.  Is it system/finder
related?  I'm using 6.0.5 on a Plus.

--
==== Scott Barvian ============ Department of Electrical/Computer Eng. ===
==== barvian@ece.cmu.edu ====== Carnegie Mellon Univ., Pittsburgh, PA  ===

owen@raven.phys.washington.edu (Russell Owen) (05/02/91)

In article <BARVIAN.91May1130523@dart.ece.cmu.edu> barvian@ece.cmu.edu (Scott
Barvian) describes a problem:
>Suppose I download a program that, after unstuffing, puts the application/init
>or whatever and a TeachText doc file in its own folder.  I then open the
>doc file, browse it, close the file (but not quit TeachText) and decide to
>trash the whole folder.  When I try to empty the trash, I get the message
>
>The Trash couldn't be emptied (a file was busy or a folder was not empty).
>
>and the (now empty folder) reappears.  Repeated attempts to trash the folder
>do no good.
...

TeachText is using that folder as its default (if you select Open or New 
you'll find yourself in that folder). So you either have to quit TeachText
(and any other applications also using that folder) or set a different default
(a royal pain if several apps are using it).  I usually just rename such
folders
to "junk" and put them at the root level. On next reboot I trash them.

I agree it's frustrating and stupid. Why the Mac can't just trash the folder
and move the applications' default folder up one level I don't know.

-- Russell
owen@raven.phys.washington.edu

barvian@ece.cmu.edu (Scott Barvian) (05/02/91)

(Russell Owen) writes:

   (Scott Barvian) describes a problem:
   >...
   >trash the whole folder.  When I try to empty the trash, I get the message
   >
   >The Trash couldn't be emptied (a file was busy or a folder was not empty).
   >
   >and the (now empty folder) reappears.  Repeated attempts to trash the folder
   >do no good.
   ...

   TeachText is using that folder as its default (if you select Open or New 
   you'll find yourself in that folder). So you either have to quit TeachText
   (and any other applications using that folder) or set a different default
   (a royal pain if several apps are using it).  I usually just rename such
   folders
   to "junk" and put them at the root level. On next reboot I trash them.

   I agree it's frustrating and stupid. Why the Mac can't just trash the folder
   and move the applications' default folder up one level I don't know.

I've gotten several replies along this general theme.  I can understand why
TeachText has a deep-seated psychological need for its current folder to be
available.  That's why I always quit out of it instead of closing files when
I'm in "browse and trash" mode- it's so small that the delay in opening the
application is acceptable.

No one so far has addressed my real question: why do background DAs, which
don't have a file/folder associated with them, prevent me from trashing
folders which were used by *other* applications?  I have a desktop calendar
DA (which uses no files) open in the background, and I can't get rid of the
folders locked up by TeachText until I quit both TeachText and DA Handler.

Maybe I'm describing the symptoms of some other problem. 
--
==== Scott Barvian ============ Department of Electrical/Computer Eng. ===
==== barvian@ece.cmu.edu ====== Carnegie Mellon Univ., Pittsburgh, PA  ===

lsr@Apple.com (Larry Rosenstein) (05/03/91)

The issue is not specific to TeachText.  I believe that the same thing
happens with any application.  The technical reason is that the system
opens a working directory, and passes the working directory id to the
application.  Until that working directory is closed the folder is in
use.

The behavior you see with DAs happens because DAs are run in the DA
Handler application.  If one DA uses a folder, then you have to quit the DA
Handler (ie close all DAs) before the working directory will be closed.