Re: What causes Finder 'Volume in use" alert? (Eric Peyton)
Re: What causes Finder 'Volume in use" alert? (Eric Peyton)
- Subject: Re: What causes Finder 'Volume in use" alert? (Eric Peyton)
- From: "Tony" <email@hidden>
- Date: Thu, 27 Sep 2001 23:30:38 -0400
Eric,
thanks for detailed explanation. Indeed, I saw kernel message in the console
log.
Further inspection of my code revealed that I was not releasing one
NSFileWrapper object.
While I used C lib fopen() to create the file (due to legacy code) I
packaged
them all into one directory by creating NSFileWrapper for each file and by
adding them
to NSFileWrapper object for the directory. Then I forgot to release the
wrapper for one file,
even if I called fclose() on the file itself.
Obviously, NSFileWrapper is just another memory mapped file.
Tony
Re:
>
When you hit Cmd-E or otherwise attempt to eject a disk
>
a) The applications stack ends up asking Disk Arbitration (the
>
atuodiskmount daemon) to eject the disk.
>
b) autodiskmount asks every application that subscribes (all Cocoa and
>
Carbon apps, and a few daemons) if it is okay to eject. This is done
>
under the hood for all Cocoa and Carbon applications. If a daemon
>
subscribes to arbitration notifications, they need to handle it.
>
c) All applications respond to autodiskmount saying yea or nay, like I
>
said, this is "done for you".
>
d) If all applications respond "sure - eject it", autodiskmount tries
>
to eject it.
>
e) The kernel can still say no of course. This is probably what is
>
happening. Any daemon or application that still has files open or
>
mapped will cause the kernel to say no.
>
f) In the case where the kernel says no, there should be a log in the
>
console log from autodiskmount with an error like this ...
>
Sep 23 10:38:43 spawn /sbin/autodiskmount[110]: UnmountDisk('disk2s2')
>
unmount('/Volumes/Untitled') failed: 16 (Device busy)
>
Is this happening for you?
>
What logs do you see in Console when you attempt to eject the device?
>
Do you specifically modify the Desktop Database while the files are
>
open? Are you closing the DesktopDB?