[OT] Re: MDItemCopyAttribute and kMDItemFinderComment
[OT] Re: MDItemCopyAttribute and kMDItemFinderComment
- Subject: [OT] Re: MDItemCopyAttribute and kMDItemFinderComment
- From: Alastair Houghton <email@hidden>
- Date: Tue, 21 Apr 2009 14:01:35 +0100
On 21 Apr 2009, at 13:04, Chris Idou wrote:
I've got a program which uses MDItemCopyAttribute to get the
kMDItemFinderComment, and I was playing around testing it, by changing
the value in the Finder and seeing if the value changed in my
program, and they ended up out of synch. It ends up that mdls
returns a different value than xattr -l,
and MDItemCopyAttribute doesn't return the up to date value. Now
that its out of synch, updating the value in Finder doesn't get it
back in synch.
Is this expected behavior? Should I be using something other than
MDItemCopyAttribute to get the most up to date value?
My guess is that you want to be using getxattr() for this; I would
imagine that the metadata functions and mdls are probably looking in
Spotlight's data store for their information, and if Spotlight hasn't
updated its data yet from the file, it could be out of sync.
All of this is just a guess though; I haven't played very much with
the Spotlight end of the metadata system (just the lower level BSD and
underlying filesystem implementations).
Kind regards,
Alastair
p.s. This is off-topic for cocoa-dev. There are lots of other mailing
lists, both those on Apple's site and others like Omni's macosx-dev,
which might be better places to ask this question.
--
http://alastairs-place.net
_______________________________________________
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