Re: Resource Fork - is this a good use/the right thing to do?
Re: Resource Fork - is this a good use/the right thing to do?
- Subject: Re: Resource Fork - is this a good use/the right thing to do?
- From: Daniel DeCovnick <email@hidden>
- Date: Thu, 24 Apr 2008 03:16:07 -0400
I read that. I'm not sure I completely know what the resource map is.
The resource manager keeps track of a table of resource types, and
subtables of resource names or ID's as the key in a key-value pair,
where the resources themselves are the values. Is that what the map
is, that whole data structure that the manager keeps track of?
FWIW, as far as manipulating resource forks go, I was planning to use
the NDResourceFork classes (see further up this thread about 20
posts). If what that does is the wrong way to go (I suspect it's not),
let me know. And, if I'm wrong about what the map is, if by using
NDResourceFork I don't need to concern myself with what a resource map
actually is so long as I make sure I stick to my own crazy 4-char
resource type (say, dåNd, or s¥$w) and valid resource ID ranges, let
me know that also. :-)
And if I do have a substantial part of that right, what are the limits
I need to worry about? Uli mentioned a limit of 2727 resources per
fork. While that seems absurdly low, it's not like I'd be using a
resource for every piece of data I need to keep track of. Far simpler
just to serialize my data and write it to a single resource if that
sort of limit exists; shove my XML or binary data into
blah.blah>resource fork>s¥$w>128. I know that a single resource can be
at least 3 MB*. What's the limit there, for instance?
-Dan
*How do I know? Funny story, but the moral is I ended up writing "I
will not paste 3 images into ResEdit PICT resources and then email the
plugin to someone on dialup" 50 times in penance using a SimpleText
copy with the Paste menu item removed.
On Apr 24, 2008, at 2:27 AM, Chris Suter wrote:
On 24/04/2008, at 4:14 PM, Daniel DeCovnick wrote:
Honestly, I don't care how the data is stored, as long as I've got
some reliable place to store file-specific data such that it can be
reliably tied to the file (cross-user/cross-computer concerns are
primary, cross-platform concerns are secondary - I'm only writing
this for OS X currently, and I could always have export and import
functionality to keep a real file around while the target file gets
sent out and about and then recombine them later). If that means
writing raw binary or XML data to an unformatted resource fork,
that's fine. If that means I've got to put it into a resource with
it's own type, that's fine too (this would be a bit more reliable,
I imagine, as it's possible I'll run into files with other things
in their resource forks already). If that means something else
entirely, that's cool too.
Now, if y'all could explain what a resource map is (the docs don't
show anything meaningful) and why I might be using it, it'd be
appreciated.
You don't want to manipulate it directly.
Use the API documented here:
<http://developer.apple.com/documentation/Carbon/Reference/Resource_Manager/Reference/reference.html
>
- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden