Disk Access at raw level

Discussion in 'Mac Programming' started by waqarg, Dec 3, 2011.

  1. waqarg
    Expand Collapse
    macrumors newbie

    Joined:
    Dec 2, 2011
    #1
    Hi,

    Em new to mac, em not familiar with xcode and its libraries, i want to access my hard drive sectors means want to read them using objective c in cocoa application... any help would be highly appreciated.... :)
    Regards,
     
  2. kainjow
    Expand Collapse
    Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    There are no Objective-C classes out of the box for this. Of course you can write your own. Simplest way is to use DiskArbitration framework to get the available drives, grab the BSD name (kDADiskDescriptionMediaBSDNameKey) from the DADiskRef and feed that to opendev().

    Internal/startup drives requires root permission to open though.
     
  3. waqarg
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Dec 2, 2011
    #3
    Hi kainjow!

    Thanks a lot for reply, now em going to check what you have suggested....
    For others, any other simpler way or suggestion could be an absolute pleasure for me.....
     
  4. foidulus
    Expand Collapse
    macrumors 6502a

    Joined:
    Jan 15, 2007
    #4
    Not really going to find anything simpler, Apple's Objective-C frameworks were never really designed to go that low level, so you are stuck using the C API for most things(and as luck would have it, all valid C code is valid Objective-C code :p)
     

Share This Page