This appears to be a known problem; at least, I found the same question here and there using Google, but no answers. I thought it might be possible to use NSWorkspace, but it appears to have the same problem. What does appear to work is to ask the Finder via Apple script. Create a script called, say, "isVolumeEjectable" and implement it as follows.

on run {volumeName}
        tell application "Finder"
                return ejectable of disk volumeName
        end tell
end run

Then call it like so.

For i as Integer = 0 to VolumeCount - 1
  dim v as Variant = IsVolumeEjectable(Volume(i).Name)
Next

This script returns true for a mounted Firewire volume on my machine, and agrees with the result of calling PBHGetVolParmsSync for all other volumes mounted here.

Probably you could also try calling IOKit :)

Charles Yeomans



On May 29, 2006, at 3:52 PM, Dennis Birch wrote:

I implemented the suggested declares solution in a module and it works
great for CD-ROMs and USB devices I've mounted. However my external
FireWire drive (which can be safely unmounted in the Finder) does not
show as being ejectable. Anybody happen to know why that might be the
case?

On 5/23/06, Charles Yeomans <[EMAIL PROTECTED]> wrote:
This information is not hard to retrieve for MacOS.  You call
PBHGetVolParmsSync.  You test the extended attributes field of the
GetVolParmsInfoBuffer struct passed.  The volume is ejectable when
bit 0 is set.  The Volumes section of chapter 4 of my declares book
has an example that calls PBHGetVolParmsSync.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to