Re: Flattening Mac resource files?
Re: Flattening Mac resource files?
- Subject: Re: Flattening Mac resource files?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Thu, 27 May 2004 17:13:01 +0200
At 23:18 Uhr -0400 26.05.2004, Tito Ciuro wrote:
Some Mac files contain a resource fork. The question I have is: how
can I "flatten" the resource fork (resource fork-within-data fork)
so that I can move the file to other systems?
There are several standard archive formats that do this. MacBinary
and BinHex have already been mentioned. These are really the best
choice. Source code for packing and unpacking files in these formats
can be found on the web.
Are there any facilities in Mac OS X that will allow me to do this?
I would also need to do the opposite when reconstructing the file
again on the Mac side.
If you're using a proprietary protocol to transfer these, just
transfer both parts. You can read a resource fork's raw data by
accessing the file as filename/rsrc, or something like that (most
guides on using the Terminal tell you what exactly the proper path
is), but you'd still have to carry along file attributes like
permissions and resource type/data, which MacBinary and BinHex handle
for you.
The Rez/DeRez approach really isn't appropriate here. Rez is a
text-based language that can be used by programmers to define custom
resources that will then be compiled into a resource file. As such,
it's rather inefficient, and it also doesn't include the metadata
that is stored for a file, nor does it include the data fork. You'd
still be transmitting two separate parts of the file.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.