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
8
votes
2 answers

Interpret return value (dissenter) when trying to unmount volume in OS X

I'm trying to unmount a volume in my Cocoa application using the Disk Arbitration Framework. Before calling: DADiskUnmount(disk, kDADiskUnmountOptionDefault, unmountCallback, self ); I register a…
Jan Linxweiler
  • 382
  • 2
  • 9
8
votes
1 answer

How to iterate all mounted file systems on OSX

I am interested in iterating all mounted file systems on OSX (currently running 10.9 Mavericks). I am looking for something similar to getmntent() or the output of the mount shell command (although I want to do it from objective C, so parsing the…
John Bowers
  • 1,695
  • 1
  • 16
  • 26
6
votes
2 answers

How can I prevent ejection of a disk during an operation on Mac OS X?

I have a long-running task that performs a series of file operations on mounted USB drives and I want to prevent users from ejecting the drive from Finder (or elsewhere) while this happens. There is a Cancel button that allows the task to be ended…
mcsheffrey
  • 508
  • 4
  • 16
6
votes
1 answer

OSX-Mounting DVD programmatically does not launch user specified application

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…
6
votes
0 answers

programmatically mount a disk image(DMG) in mac os x

Q. How to mount an apple disk image programmatically ? My approach is similar to use disk arbitration for mounting as shown here. I prefer not to use any command line tool. The un-mount and eject works perfectly but the mount needs a BSD…
bikram990
  • 1,085
  • 1
  • 14
  • 36
6
votes
1 answer

Mac OS X Sandbox and Disk Arbitration

There doesn't seem to be an entitlement for use of the DVD drive when you sandbox your app. Has anyone come up with a way to access it, specifically with the disk arbitration notifications?
Ben Trengrove
  • 8,191
  • 3
  • 40
  • 58
5
votes
2 answers

Programmatically mount a disk/volume using only a given file path in Mac OS X

I have a list of file paths. These paths may lead to files on unmounted Volumes. How can I programmatically tell the OS to mount the volume before I try to access the file? I know this is possible somehow, as iTunes appears to do it. For example, if…
BigMacAttack
  • 4,479
  • 3
  • 30
  • 39
4
votes
3 answers

Programmatically retrieve an OS X disk partition UUID

I have a path to a partition. How can I retrieve UUID of that partition programatically without using terminal commands? An example will be more helpful.
surendran
  • 478
  • 1
  • 8
  • 19
4
votes
2 answers

Thunderbolt drives not marked as ejectable in disk arbitration/iokit although they clearly are

I am developing an application that uses disk arbitration to find out which devices are connected to a machine and react to connect/disconnect events and that has been working well for years. Just recently I discovered that something does not work…
user1573546
  • 523
  • 5
  • 13
4
votes
1 answer

Unmount disk in OSX with DiskArbitration

I'm trying to unmount a disk in OSX. The code works fine, but the callback is not called when the disk is unmounted successful only when it gives an error. I read the DiskArbitrationProgGuide and followed the steps, but no progress yet. Could…
4
votes
2 answers

Detect when removable storage is unmounted

I am working on an app which should detect events that happen when removable storage is unmounted or forcefully unplugged from the USB. How can I receive these events? I have seen NSWorkspace for the first possibility of smoothly unmounting the…
King
  • 239
  • 3
  • 17
3
votes
1 answer

Renaming a mounted disc image

The "source" below is a mounted disc image (dmg), named "New." I'm trying to rename it with a textField string and action. When I complete the action the rename fails and I am unable to eject it. The code works with standard files and folders. Also…
Paul
  • 101
  • 1
  • 6
3
votes
0 answers

I am trying to get newly attached disk (Pen Drive) MOUNT POINT in MAC OS with C code

I am new to MAC OS X. I want to get Mount Point of newly attached disk (Pen Drive). I already tried some code and got mount path from command diskutil info disk1S2 | grep \" Mount Point: \" | awk '{print $3}' where disk1S2 is Identifier of newly…
Omkar
  • 343
  • 3
  • 12
3
votes
2 answers

USB peripherals arbitration on macOS

The DiskArbitration framework on macOS provides a simple way to intercept volumes mounts and authorise it or not using DARegisterDiskMountApprovalCallback. I'm looking for something similar for all the other USB devices like HID devices, network…
Kappe
  • 9,217
  • 2
  • 29
  • 41
3
votes
1 answer

Correct syntax to unregister a callback in the DiskArbitration framework

I'm going to implement an observer to be notified when a specific volume disappeared. The notifications in NSWorkspace are not an option, because I need a notification about device switched off rather than device unmounted. Registering is pretty…
vadian
  • 274,689
  • 30
  • 353
  • 361
1
2 3 4