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: Gerd Knops <email@hidden>
- Date: Wed, 23 Apr 2008 11:41:02 -0500
Coincidentally I just went through that same song and dance. With
Spotlight becoming more and more important in OSX, it is surprising
Apple has not provided a clean method to store arbitrary metadata with
any kind of file. Maybe time for us all to file an enhancement request.
As others have mentioned, all currently available methods have
drawbacks:
- resource fork: Antiquated, entire data has to be read and stored
back to even change a flag, creeping feeling they might be dropped at
some point, care has to be taken which tools are used to process the
files so resource fork is not lost.
- xattrs: limited storage per attribute, tools may loose them.
- Other approaches like db, links, hidden files etc: Separation of
file and metadata, no support by standard tools, synching is tricky.
Adobe attempted to solve the dilemma for graphic files by introducing
XMP (http://www.adobe.com/products/xmp/), but it suffers from serious
drawbacks:
- Not a generic solution
- Entire files have to be rewritten to modify metadata
- Adding the metadata in some file formats seems like a hack, and has
limitations that are dependent on the file format
- Overly complicated and limiting storage schema
- SDK seems overly complicated (mildly speaking) and still lacking
core functionality
Of course there are advantages to:
- Platform independent
- Metadata stays with files, no special knowledge required by file-
handling tools, file systems or OS
But overall no clear winner. Only option is to analyse one's design
goals, and pick the lesser of the evils.
In my opinion the best hypothetical solution would be if each file
comes with a related directory that allows for storage of arbitrary
metadata. However the hurdles of introducing something like that are
enormous: All tools (simple tools like cp, complexer tools like tar,
zip, rsync) would need to add support, and ways to make storage on
alien file systems and efficient use through network file systems
would have to be found.
With metadata becoming more and more important in daily use it would
be great if a platform independent way of storing metadata would be
devised. But I am not holding my breath. In the mean time we all
muddle along with our individual solutions...
Another, though related, issue is that spotlight importers still can
not be cascaded. Even just adding a few simple fields of metadata to
an existing file format means one has to re-implement the importer for
that format from scratch, no way of 'sub-classing' existing importers.
Gerd (filing an enhancement request next)
_______________________________________________
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