6

I have used disk-arbitration framework for managing various drives and disks.

I have registered callback functions DADiskAppearedCallback and DADiskDisappearCallback.

For the usb drives all seems to work perfectly but for the CD/DVD I am facing the problem.

After CD/DVD get loaded I have unmount (DADiskUnmount()) the drive using BSDName of the disk. Then after some verification of the disk I do mount (DADiskMount()) the disk again using BSDName.

When I mount CD/DVD again, the default application set in the

system preference->Hardware->Cds & DVSs

is not getting launch.

For eg. For Video DVD - Open DVD Player. Here DVD player should get launched.

How do I overcome this problem?

I am still searching for the solution came across, "SystemUIServer" manages the application that should mount on insertion of CD/DVD. Can I able to trigger that action on the CD/DVD mount? Or Is this proper way to manually launch user provided application on CD/DVD mount?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • What is the output of the `mount` command when you don't intercept the mount compared to the output after you have mounted it programmatically? In particular, are there important mount options? If so, you might need to use `DADiskMountWithArguments()` so you can pass those. Also, if you unmount and re-mount the volume using `umount`/`mount` or Disk Utility, does the user-specified app get launched? – Ken Thomases Jan 15 '15 at 06:06

1 Answers1

1

You might try tickling it with NSWorkSpace

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/index.html#//apple_ref/c/data/NSWorkspaceDidMountNotification

First create an NSNotification of type NSWorkspaceDidMountNotification

Be sure to set the userInfo dictionary KVPs as appropriate. (In the NSWorkspace docs)

Finally, post the notification to the workspace Notification Center [NSWorkspace notificationCenter]

I suspect that might be the trick.

EDIT This doesn't seem to do the trick

uchuugaka
  • 12,679
  • 6
  • 37
  • 55