Get bytes per sector of Drive in MAC

Discussion in 'Mac Programming' started by Nishad, Aug 10, 2008.

  1. Nishad macrumors newbie

    Aug 2, 2007
    Hi all,

    I am working in Cocoa - Objective C. My application need information of the system drive and the USBs(Ipod also) connected to the system, like Drive size, Bytes per sector, drive mounted path, serial number etc. I tried by reading ioregistry properties with a matching dictionary created using IOMediaclass and iokitframework and i am getting the size, mounted path serial number, product name except BYTES PER SECTOR.

    Can anybody help me to get the bytes per sector of the drive or how can create matching dictionary which will give bytes per sector of the drive?

    With thanks and regards
  2. tedsmith3rd macrumors member

    Aug 30, 2006
    I think IOMedia's getPreferredBlockSize yields the media's sector size. You might want to download the source code for darwin's IOStorageFamily to make sure.
  3. Sayer macrumors 6502a


    Jan 4, 2002
    Austin, TX

Share This Page