Re: Is There No Limit?
Re: Is There No Limit?
- Subject: Re: Is There No Limit?
- From: Axel Luttgens <email@hidden>
- Date: Mon, 19 Mar 2012 18:51:22 +0100
Le 18 mars 2012 à 23:41, Axel Luttgens a écrit :
> Le 18 mars 2012 à 23:16, Shane Stanley a écrit :
>
>> Try your test again using xattr and a key of com.apple.metadata:kMDItemFinderComment.
>
> Yes, this returns the raw comment as a bplist.
> Just another view of the same data.
Hello Shane,
Sorry, I've been a bit elliptic.
I meant it in the opposite direction: mdls somehow provides another view of the extended attribute.
Because it seems that the fact of writing (or deleting) a limited set of extended attributes is also automatically registered against mdls, and the latter will import (or remove) those attributes into (from) its store almost instantaneously.
Since mdls is always running and quite well behaving, an attribute such as a kMDItemFinderComment and its representation in the spotlight database should, for all practical purposes, always be in sync.
But is the kMDItemFinderComment attribute (or its representation in spotlight) the "true" Finder comment?
When setting an item's comment through the Finder (with the help of the information window or by script), it seems that the following happens (since Leopard?):
- the Finder creates or rewrites the corresponding extended attribute through the fsetxattr() call,
- the Finder creates or rewrites an entry in the relevant .DS_Store file
When retrieving an item's comment, the Finder mainly looks in the .DS_Store file, but never tries to read the item's extended attribute.
As a result, deleting the .DS_Store file and restarting the Finder (to avoid cached data) will display or return an empty Finder comment, even if the kMDItemFinderComment is still present. From the Finder's point of view, the comment is lost.
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden