Questions tagged [diskarbitration]

DiskArbitration.framework is available on OS X, and provides mechanisms for registering for mount/unmount notification and blocking mount/unmount events.

DiskArbitration.framework documentation is available here:

http://developer.apple.com/documentation/Darwin/Reference/DiscArbitrationFramework/

NSWorkspace can be used for a subset of the supported actions:

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/

52 questions
0
votes
1 answer

Convert NSArray to CFStringRef *

I need a way to convert an NSArray to a null terminated list compatible with the arguments option of DADiskMountWithArguments. The documentation specifies the argument option to be a "Null terminated list" of type CFStringRef arguments[]. I have…
0
votes
2 answers

Cocoa equivalent of diskEvt/kEventClassVolume?

We have a drop-down menu of volumes in our UI, and I'd like to update it when a new disk is mounted. In the Classic days, this would involve watching for a diskEvt event. In Carbon, I think this was kEventClassVolume. What's the Cocoa equivalent? (A…
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
0
votes
1 answer

Disk Arbitration and OK button issue

The code below is used to get the list of disks (void)da_tools { DASessionRef session; session = DASessionCreate(kCFAllocatorDefault); DARegisterDiskAppearedCallback(session, NULL, disk_appeared_callback, (void *)NULL); …
0
votes
1 answer

Create string from DiskArbitration CFUUID object

In my program I'm using DiskArbitration to check some values against a database and, if certain conditions happen, do something before it mounts. I'm using DARegisterDiskPeekCallback with this callback: DARegisterDiskPeekCallback(diskSession,…
josh
  • 9,656
  • 4
  • 34
  • 51
0
votes
1 answer

How do I get notification of a drive being powered on?

I have a problem on OS X, where if a drive is plugged in while powered off, and then powered on, I don't receive notification that a new disk has appeared. I do receive notification if I plug in a drive that is already powered on. Currently, I'm…
Collin Dauphinee
  • 13,664
  • 1
  • 40
  • 71
0
votes
1 answer

How can you get notified, if a volume is still used by an application?

If you have a document open and want to unmount a volume, os x opens this alert panel, that the document is still in use by program x. How can you get notified about this in cocoa? I tried the DADiskArbitration framework, but this doesn't send a…
Oath Comrade
  • 283
  • 2
  • 9
0
votes
2 answers

Cocoa get disk in NSArray

hi I'm using DiskArbitration.framework to get list of disks +(NSArray*)arrayOfDisks { DASessionRef session = DASessionCreate(kCFAllocatorDefault); if (session) { DARegisterDiskAppearedCallback(session, NULL, driveGo, NULL); …
user840250
  • 727
  • 1
  • 8
  • 20
1 2 3
4