Writing Spotlight metadata to files on OS X (specifically kMDItemDisplayName)
问题 I see that this has been answered previously by Ken T., but I have a case where the code appears to work, and the call to setxattr() returns 0, but the item I want to modify does not change. Specifically, I'm trying to change the metadata attribute kMDItemDisplayName, and my call looks like this (modeled after the sample posted by Ken T): [Note: the "name" param below is an NSString *] rc = setxattr([pathString cStringUsingEncoding:NSUTF8StringEncoding], "kMDItemDisplayName", [name