Re: Accessing Classic Mac Resources from Cocoa
Re: Accessing Classic Mac Resources from Cocoa
- Subject: Re: Accessing Classic Mac Resources from Cocoa
- From: Dietmar Planitzer <email@hidden>
- Date: Sat, 23 Feb 2002 15:46:21 +0100
>
From: Finlay Dobbie <email@hidden>
>
Date: Sat, 23 Feb 2002 11:41:53 +0000
>
To: Charles Srstka <email@hidden>
>
Cc: John Pattenden <email@hidden>, email@hidden
>
Subject: Re: Accessing Classic Mac Resources from Cocoa
>
>
On Saturday, February 23, 2002, at 01:58 AM, Charles Srstka wrote:
>
>
> There's a function somewhere called FSPathMakeRef that will get you an
>
> FSRef from a path. From there, you can get an FSSpec from the FSRef
>
> somehow, I think.
>
>
There's a function in CFURL.h called CFURLCopyRef() or something that
>
returns the FSRef of a CFURL. Then you can create an FSSpec from the
>
FSRef quite easily, I forget the exact call. Then you can write a nice
>
obj-c wrapper around the resource manager and open source it! :-)
Another option would be to open the resource file via the FSOpenResFile()
function which takes a FSRef directly. This way its not necessary to
translate the FSRef into an FSSpec.
I would strongly recommend that one always uses the FSRef version of a given
Carbon API rather than the FSSpec version, because the former has no problem
supporting long filenames.
Regards,
Dietmar Planitzer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.