Re: NSFileManager not preserving Spotlight comments
Re: NSFileManager not preserving Spotlight comments
- Subject: Re: NSFileManager not preserving Spotlight comments
- From: John Stiles <email@hidden>
- Date: Mon, 3 Apr 2006 15:43:53 -0700
You can set comments on a file via AppleScript.
You can copy a file in a comment-preserving way via FSCopyObject, but
it's no longer a Cocoa API which is what the OP asked for.
On Apr 3, 2006, at 3:35 PM, Paul Kim wrote:
My guess based on my limited experience is that if you are copying,
it's a new file, and it will get reindexed by Spotlight. Unless the
comment is something that a Spotlight importer derives from the
file itself (i.e. not added after the fact), it won't carry over.
Of course, I have not confirmed this either way.
If this is indeed the case, then you can try setting the comments
manually but it requires a private API (unless I am missing
something here). Or, if you find you can get away with moving the
file instead, the metadata should be intact (though I'm not sure
how it works across filesystems. I'm guessing not in those cases).
paul
On Apr 3, 2006, at 2:39 PM, email@hidden wrote:
Hi,
My application uses the following methods to copy files and their
attributes. It seems, however, that the Spotlight comments (as can
be seen in the Finder's Get Info panel) are not copied by these
API calls.
I'm using the following code:
if ([manager copyPath:sPath toPath:dPath handler:self]) {
[manager changeFileAttributes:[manager
fileAttributesAtPath:sPath traverseLink:YES] atPath:dPath];
}
else {
// other code
}
Is there a Cocoa method to copy files while preserving Spotlight
comments? If not, what would be the best approach to do this?
Thanks in advance!
peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden