• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Difference between dvd and dmg
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Difference between dvd and dmg


  • Subject: Re: Difference between dvd and dmg
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sun, 23 Oct 2005 22:10:13 +0200


On 23.10.2005, at 20:02, j o a r wrote:

On 12 okt 2005, at 18.54, Gerriet M. Denkmann wrote:

This is correct. So the question should be:

When one opens a raw device via open(/dev/rdisk...) how does one get the hardware sector size (which in this case is needed for read or pread)?

It seems to be 512 for disks, 2048 for rotating media. But maybe there is something better than trial and error?

You can get this value from IOKit fairly easily, using "kIOMediaSizeKey".

I looked up kIOMediaSizeKey:
#define kIOMediaSizeKey "Size"
The kIOMediaSizeKey property has an OSNumber value and describes the total length of the media in bytes.


So maybe "Size" is not really what I am interested in.

But I found another property: kIOMediaPreferredBlockSizeKey = "Preferred Block Size" which is 512 for my hard disk, and 2048 for a CD with HFS+.
"The kIOMediaPreferredBlockSizeKey property has an OSNumber value and describes the media's natural block size in bytes. This information is useful to clients that want to optimize access to the media."


Is there a "fairly easy" way to get the appropriate IOKit dictionary from a bsd-name (like /dev/rdisk1s2) ?

Kind regards,

Gerriet.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Difference between dvd and dmg
      • From: j o a r <email@hidden>
References: 
 >Re: Difference between dvd and dmg (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Difference between dvd and dmg (From: John Stiles <email@hidden>)
 >Re: Difference between dvd and dmg (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Difference between dvd and dmg (From: j o a r <email@hidden>)

  • Prev by Date: Re: FSRefMakePath: error -35
  • Next by Date: Re: Difference between dvd and dmg
  • Previous by thread: Re: Difference between dvd and dmg
  • Next by thread: Re: Difference between dvd and dmg
  • Index(es):
    • Date
    • Thread