Re: Cocoa stripping resource forks: does Jaguar fix?
Re: Cocoa stripping resource forks: does Jaguar fix?
- Subject: Re: Cocoa stripping resource forks: does Jaguar fix?
- From: "Clark S. Cox III" <email@hidden>
- Date: Sat, 06 Jul 2002 20:34:45 -0400
On 07/06/2002 17:13, "Ondra Cada" <email@hidden> wrote:
>
On Saturday, July 6, 2002, at 09:21 , Michael Tsai wrote:
>
>
> If you
>
> bundle one of these files into a package, other apps won't know what
>
> to do with it.
>
>
That's still the best way to do it. If you have a package and a
>
non-package-savvy application, you just open the file from inside (like,
>
instead of Blah.jpg you'd open Blah.jpg/contents.jpg for contents,
>
Blah.jpg/preview.tiff for preview). Whilst agreeably mite inconvenient, it'
>
s always possible.
OK, consider this:
Running a webserver with Apache, I have several directories full of
jpeg's. I basically have two options for storing previews of these files:
1) Put the preview in the resource fork
2) Package each file, along with another file containing the preview.
If I choose 1, the webserver only reads the data fork, and everything
works as before. If, on the other hand, I choose 2, the webserver no longer
reads the package as an image file, it instead reads it is a directory.
Putting the extra data in the resource fork, allows the file's primary
contents to remain unchanged, while attaching extra data to.
>
If you used some dirty trick though like resource fork is, with
>
non-resource-fork-savvy applications you can access the data fork only,
>
and that's that.
That's the whole point. If a non-resource-fork savvy program reads a
file with a resource fork, it's only *supposed* to read the data fork.
Remember that, even on pre-OSX MacOSes, not every program read, or even
cared about resource forks. If you wrote a text editor that used stdio calls
to do all of it's file reading and writing, it could still be a fully
functional editor as text files store their data in the data fork. However,
if you used this editor to open a file with a resource fork, none of the
resources would be lost.
I think that everyone realizes that storing critical data in resource
forks are depreciated for new development, however that is no excuse to
destroy data in files written by older programs.
--
Clark S. Cox III
MacOSX Programmer, available for hire
http://clarkcox.dyndns.org/
email@hidden
_______________________________________________
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.