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
1
vote
1 answer

Detect when an ejectable device is (un)plugged in OS X

I am wondering how to be notified when a mass storage device is plugged (or unplugged) to the Mac.
AP.
  • 5,205
  • 7
  • 50
  • 94
1
vote
0 answers

Swift Array of strings to UnsafeMutablePointer>!

I am trying to call DADiskMountWithArguments using Swift. swiftfunc DADiskMountWithArguments(_ disk: DADisk, _ path: CFURL?, _ options: DADiskMountOptions, _ callback: DADiskMountCallback?, _ context: UnsafeMutableRawPointer?, _ arguments:…
1
vote
1 answer

Convert DAAppearanceTime to Date

How can the DAAppearance Time from the Disk​Arbitration be converted to a valid Timestamp? I tried the following: if let appearanceTime = diskinfo["DAAppearanceTime"] as? NSNumber{ print(appearanceTime) …
nja
  • 571
  • 1
  • 7
  • 15
1
vote
1 answer

Programmatically get OSX Fusion Drive information

I'm working on a project that links drives (and their associated stats, such as those displayed by iostat) and partitions to mount points, but running into issues with the way OS X does the Fusion Drive. I have been able to gather information on…
Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
1
vote
0 answers

Mac App Sandbox and USB device unmount

I need to unmount a USB device within Objective-C in a sandbox application. For unmount I use: DASessionRef session = DASessionCreate(kCFAllocatorDefault); DASessionScheduleWithRunLoop(session, CFRunLoopGetCurrent(),…
Jan
  • 127
  • 2
  • 8
1
vote
0 answers

How to Mount local volumes in cocoa

I have DADiskRef of drive, i want to mount it programmatically in cocoa. Here is code i have try to mount drive. NSString *diskName=[dic valueForKey:@"DAMediaBSDName"]; // i.e. disk1s2 DASessionRef session = DASessionCreate(kCFAllocatorDefault); …
Rohan
  • 668
  • 1
  • 6
  • 10
1
vote
1 answer

Is there a reliable way to know a volume is a time machine volume when using the disk arbitration framework?

I am developing an OSX application that among other things shows mounted volumes as they appear/disappear. I do that using the disk arbitration framework. When I connect my computer to a network drive that I have configured as my time machine backup…
user1573546
  • 523
  • 5
  • 13
1
vote
3 answers

Distinguishing between HFS+ and HFS Standard Volumes

IOKit and the DiskArbitration framework can tell me a lot of things about mounted volumes on a mac, but they don't seem to be able to differentiate between HFS+ and HFS Standard volumes. The IOKit/DA keys Content, DAVolumeKind and DAMediaContent…
Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
1
vote
4 answers

Detecting appearance/disappearance of volumes on osx

I want to update a list of storage devices as the user inserts USB keys, adds external disks and mounts disk images. IOKit's IOServiceAddInterestNotification looks like the way to go, but the obvious use of registering general interest in…
Rhythmic Fistman
  • 34,352
  • 5
  • 87
  • 159
0
votes
1 answer

Programmatically Find Out Type of Mounted Drive - Mac OSX

It doesn't seem that DiskArbitration framework provides a way to find out the device type (network drive, external drives, etc). Is there any other way to programmatically figure out the type of a mounted device?
Jikyu C.
  • 3
  • 2
0
votes
0 answers

Given the mounted volume's URL, retrieve the DMG file's URL using Swift

I have the URL of the mounted volume which is, /Volumes/Brave Browser. How can I retrieve the URL of the disk image file using Swift? As you can see from the screenshot, it's filepath is /Users/saisudheep_n/Downloads/Brave-Browser.dmg. I have tried…
0
votes
1 answer

Listing all connected iDevices in Cocoa

I want to implement a sort of backup feature for my backup app, but since I can not do that on the device, I have to do it on the Mac. How would I go about listing the connected iDevices (iPhone and iPod Touch mainly) on the computer? I assume I…
Tristan
  • 3,058
  • 6
  • 40
  • 68
0
votes
0 answers

API to retrieve network path for a volume on OSX

I'm looking for a native OSX API to do the same as this unix command: df -P /Volumes/samples Filesystem 512-blocks Used Available Capacity Mounted on //doe@stor.foo.com/samples 17414365488 2684246752 14730118736 …
user1573546
  • 523
  • 5
  • 13
0
votes
1 answer

Is there a way to keep internal drive segments unmounted while booting from external device

For forensic imaging of drives and/or segments with a native Mac application, I'm booting from external device (usb, hdd, etc.) into BaseSystem. I want to keep the internal drives and/or segments unmounted during the boot process (there is no way of…
ANSerpen
  • 323
  • 3
  • 11
0
votes
1 answer

DiskRef disappears while enumerating disks in callback method

I have used the DiskArbitration classes from the project Disk-Arbitrator on GitHub in a project I'm working on. I am mounting/unmounting OS X Installer Disk Images via hdiutil and sometimes the callback method defined for…