Finder comment stores get out of sync after renaming files
Originator: | tempelmann | ||
Number: | rdar://FB17198285 | Date Originated: | 11 April 2025 |
Status: | open | Resolved: | |
Product: | macOS Finder | Product Version: | 15.4 |
Classification: | Incorrect/Unexpected Behavior | Reproducible: | always |
Programs trying to access so-called "Finder comments", i.e. what the user can input via Get Info, have a hard time to get to the information in an efficient manner. The only "safe" method is AppleScript, and that is super slow. For programs scanning 100000s of files on a disk, e.g. to search for specific comments, will be taking VERY long. While there are two not officially doc'd methods, e.g. asking Spotlight or looking at the file's EAs, both have issues. Part of the issues are bugs (see below) and another is that not all volumes are indexed by Spotlight. It could all be quite easy if only the EA was properly kept in sync with the data where Finder actually remembers comments: the .DS_Store file. But when renaming or copy-replacing files in Finder, the Finder fails to update the comment in the file's EA. Meaning it gets out of sync. Similarly, even Spotlight's comment field may be out of sync for a while, until the user opens the file, because it seems that a rename or copy-replace does not trigger an immediate re-indexing by Spotlight, and I've seen the comment known to Spotlight remain incorrect for many minutes, until I decided to open the renamed or copied file. The details, with STR, are explained in my blog: https://blog.tempel.org/2025/04/FinderCommentInternals.html I have also added this SO answer where devs are looking for ways to read or alter comments: https://stackoverflow.com/questions/34711066 Overall, it would be grand if there was an API for getting/setting comments, but that doesn't seem to be happening (supposedly, someone asked for this already over a decade ago, probably others even longer ago). However, the fact that the kMDItemFinderComment EA gets out of sync, could be considered a bug (there must be a reason why it's even created in the first place, I hope), so maybe at least this could be looked at, along with making sure the the Spotlight index also gets updated correctly in the case a file with a comment gets renamed or replaces and existing file (all explained in my blog text).
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at feedbackassistant.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!