Re: Adding Spotlight comment data to folder/file
Re: Adding Spotlight comment data to folder/file
- Subject: Re: Adding Spotlight comment data to folder/file
- From: Greg Guerin <email@hidden>
- Date: Mon, 11 Jul 2011 22:42:41 -0700
Kevin Muldoon wrote:
Well, as I indicated, it's only a bit of icing on the cake. I'm
just a bit shocked such an trivial task in a scripting language
requires such heavy lifting in Obj-C (or more accurately, C).
The Finder's "spotlight comment" is stored as an xattr attached to
the file.
To test: make a file, add a comment to it in Finder's Get Info
window, then in Terminal:
xattr -l /path/to/commentedFile
The xattr name is com.apple.metadata:kMDItemFinderComment. The
contents is a bplist (binary plist) containing the comment data.
Maybe google the xattr name for more info. Also see the output of
'xattr -h' (xattr cmd's builtin help summary).
There are C functions for working with xattrs, which I've found were
quite easy to use. See 'man getxattr' and then check the other xattr
functions listed under SEE ALSO. Also check the output of: 'apropos
xattr'.
-- GG
_______________________________________________
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