Opening a file from a DMG.
Opening a file from a DMG.
- Subject: Opening a file from a DMG.
- From: "Matt Fox-Wilson" <email@hidden>
- Date: Tue, 31 May 2005 16:23:13 +1200
Hi all,
I've been having a couple of problems opening a file from inside a .app
bundle in a dmg.
My app stores a resource file (its own format, flat binary file) inside its
.app bundle, and it needs to read from it when the app opens to construct
custom UI elements. This works fine when I've got the app sitting on the
desktop or in a folder somewhere on my machine, but if I try and run the app
from the dmg folder I'm going to distribute it in, I get an error.
Experimenting with it, the path the app is identifying to its resource file
looks correct, eg:
<dmgname>:<app.app>:Contents:MacOS:Resources:resource.grf
The Resources folder there is stored alongside the executable for cross
platform code reasons.
Anyway, calling FSOpenFork for that path is returning err -35 (nsvErr,
Volume not found).
When I drag the app to my machine (say, to the root of my main HD), the path
format comes back:
Macintosh HD:<app.app>:Contents:MacOS:Resources:resource.grf
Now that looks pretty much the same, and works fine with no errors. I
checked in the /Volumes folder to make sure that the dmg actually adds a
volume with its name, and indeed it does.
Does anyone know why FSOpenFork is failing in the case that the volume is a
dmg? While I don't particularly want people running the app from that folder
anyway, it looks bad if it fails to launch from there, and I can't see any
reason why the path would be invalid in this case.
- Matt Fox-Wilson
- email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden