My program reads device paths like /dev/rdisk0
from input and then it looks in IOKit
for a disk with the BSD name disk0
. For this I have to remove /dev/r
from the path.
Hard coding this path can break in future versions of Mac OS X. Therefore I though of another way: I could match the IOService
using the BSD Major and Minor version of the device.
Here's my question: Is it possible to extract the BSD minor and major numbers from a path?