dreamlax
dreamlax

Reputation: 95335

Inspect contents of a basic, unencrypted UDIF DMG file

If I mount the DMG file using system calls to hdiutil and my application quits unexpectedly, the DMG remains mounted but because I mount it privately with -nobrowse, it doesn't show up in Finder. Is there a way to mount it using some framework or API that will be smart enough to unmount if my application unexpectedly quits?

Basically, I'm looking for a way to be able to read from files within a DMG without having to mount it.

Upvotes: 2

Views: 3082

Answers (2)

vasi
vasi

Reputation: 1036

You could use libdmg to directly read the dmg rather than mounting it....though it's obviously unsupported.

Upvotes: 2

Craig S
Craig S

Reputation: 952

I think your best bet is to try to catch an exception or signal prior to exiting, and in your exception or signal handler code, unmount the DMG yourself.

Upvotes: 2

Related Questions