• 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: Tue, 11 Oct 2005 19:35:56 +0200


On 11.10.2005, at 15:04, Jonathon Mah wrote:

Gerriet,

On 2005-10-11, at 18:51, Gerriet M. Denkmann wrote:

I have mounted a data dvd and some dmg.

Both (in getfsstat) have:
fstypename = hfs
mntfromname = /dev/disk...

NSFileManager fileExistsAtPath:isDirectory: reports an existing directory for both cases.

Question:
How can I distinguish between an hfs-filesystem (as in the case of dmg) and just a directory (as in the case of a data-dvd)?



Your final question is a bit confusing, as a mounted DVD has its own filesystem too (it's not "just a directory"). Anyway, one way to determine if a volume is an image or not is to use hdiutil. It shouldn't be hard to make an NSTask run "hdiutil info -plist" and get an NSDictionary from the result.

I have: /dev/rdisk1s2 = /Volumes/Security Update /dev/rdisk2s3 = /Volumes/Some dvd

hdiutil hfsanalyze /dev/rdisk... shows that both are (as you said) valid HFS+ filesystems. The main difference is the block size: 4096 (dmg) versus 2048 (dvd).

In a program I do:

int a = open( "/dev/rdisk...", O_RDONLY, 0 ); // no problem here
ssize_t b = pread( a, ...);

Works for "Security Update" but gives errno = EINVAL for "Some dvd".

New questions:
Why does  pread() not like my "Some dvd" ?
What can I do to make it work?

Or, if this is impossible: how can I recognize beforehand those filesystems which do not work with pread?


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


References: 
 >Difference between dvd and dmg (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Difference between dvd and dmg (From: Jonathon Mah <email@hidden>)

  • Prev by Date: Re: CoreData XML error while saving
  • Next by Date: NSTask vs. NSThread
  • Previous by thread: Re: Difference between dvd and dmg
  • Next by thread: Re: Difference between dvd and dmg
  • Index(es):
    • Date
    • Thread