Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Adding resources to .rsrc file programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding resources to .rsrc file programmatically

On 8/6/03 5:17 AM, M. Uli Kusterer didst favor us with:

>> 1. 'CFBundleOpenBundleResourceMap' returns a valid
>> FileRefNum. But, opens the resource in read only mode,
>> thereby, debarring me from modifying the resources.
> I think there is a flag in the info.plist that lets you turn off
> memory-mapped resources. When a resource file is mapped to memory, it
> is faster, but also read-only.

Or it could be a permissions issue.
>> 2. 'FSpOpenResFile' returns (-1) as FileRefNum. The FSSpec
>> (i.e. 1st argument) is that of the .rsrc file within the bundle.
> That's probably because FSpOpenResourceFile() only supports
> resource-fork resource files. However, most bundles these days
> contain their resource files in the data fork.
>> 3. If I use the FileRefNum returned by 'FSpOpenDF' (for the
>> same rsrc file) in 'UseResFile', it returns (-193) i.e. resource
>> file not found.

Ouch. Read some documentation on the File Manager and Resource Manager.
> FSpOpenDF() (according to "Inside Macintosh: Files") opens the data
> fork of a file for raw reading/writing. It has *nothing whatsoever*
> to do with resource files. And don't even try FSpOpenRF(), because
> that does the same with the resource fork.
> To open a data-fork resource file, you have to use the newer
> FSOpenResourceFile() call, which can be found (with a nice little
> comment about its parameters) in <Resources.h>.

I.e., read the headers. Learn something about the APIs you're using before
you use them.

And please, have a little meeting of the programmers over there at and discuss the idea of learning about what you're doing.
Questions from almost invariably concern old technology and
demonstrate that the poster doesn't understand even the basics of writing
Mac software. Quark sells expensive software to professionals and there's no
excuse for continuing to use old technology like this, or to not understand
basic concepts. Learn how modern Mac software is written and deliver a
quality product. Anyone paying hundreds of $$$ for software is entitled to

carbon-development mailing list | email@hidden
Do not post admin requests to the list. They will be ignored.

 >Re: Adding resources to .rsrc file programmatically (From: "M. Uli Kusterer" <email@hidden>)

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.