Re: Resource fork question
Re: Resource fork question
- Subject: Re: Resource fork question
- From: Charles Srstka <email@hidden>
- Date: Tue, 2 Mar 2004 16:34:34 -0600
The icon is indeed in the resource fork. However, Cocoa's
-[NSFileManager copyFileAtPath:toPath:handler:] method does copy the
resource fork and HFS metadata, so if you use this method, you should
get the custom icon. If you copy it using BSD API's, then copying
..forknamed/rsrc to the new file will actually copy the icon
successfully, but the thing is that the custom icon bit will not get
set in the metadata, so the Finder won't look in the resource fork and
get the icon. If you use the BSD API (or create the graphic file from
scratch and want to copy another file's resource fork onto it), then on
top of copying the res fork, you need to set the custom icon bit as
well. I believe this can be done with the Carbon File Manager API's. In
particular, look at the FSGetCatalogInfo and FSSetCatalogInfo
functions.
HTH,
Charles
On Mar 2, 2004, at 11:41 AM, Peter Schols wrote:
Hello,
I'm trying to copy photoshop files (for a scientific in-house app),
including their Finder preview icons (a thumbnail of the image). I was
thinking that these icon previews are stored in the resource fork.
From the archives, it seems that it isn't possible to copy a file's
resource fork from Cocoa. I have done some tests and this still seems
to be the case. I have also tried to copy the resource fork manually
using filename/rsrc or filename/..forknamed/rsrc and while this seems
to copy the resource fork, this still does not bring back the Finder
photoshop icon preview.
So my questions:
- Is the photoshop icon preview stored in the resource fork?
- How can I copy a file, including the resource fork (and possibly
other metadata) using Cocoa calls (if possible) or using Carbon (if
there are no Cocoa options available).
Some examples or even sample code would be greatly appreciated.
Thanks in advance!
Peter Schols
Laboratory of Plant Systematics - K.U.Leuven
_______________________________________________
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.
_______________________________________________
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.