Re: NSFileManager not preserving Spotlight comments
Re: NSFileManager not preserving Spotlight comments
- Subject: Re: NSFileManager not preserving Spotlight comments
- From: Paul Kim <email@hidden>
- Date: Mon, 3 Apr 2006 18:35:34 -0400
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:
This email sent to email@hidden