macOS Tags erased after every save

• Jan 2, 2022 - 20:12

Hello folks, and Happy New Year!

I'm using OS: macOS 10.16, Arch.: x86_64, MuseScore version (64-bit): 3.6.2.548020600, revision: 3224f34.

The problem is that every time Muse saves an update to a score, it removes the Finder "Tags" that have been assigned to the file. The Mac's Finder allows you to organize your files with colorful, labeled "tags" as a form of metadata to facilitate searching and sorting files anywhere on your Mac. I've started to use them to manage all my Muse scores and their publication workflow. But I found that scores were disappearing from my workflow. More research revealed that they were getting their tags removed. I thought maybe the Mac or Dropbox was at fault. But troubleshooting revealed that Musescore is causing the issue at the time of saving.

I seem to recall seeing "dot files" when looking under the hood in the past. I'm guessing Muse creates temporary new files when handling saves? That can be fine, but you have to preserve and filesystem metadata (tags are only one example) when doing so, or people are going to experience data loss.

Or perhaps I'm barking up the wrong tree.

Can someone help here?

Thanks!

p.s. If you're not familiar with Tags, this will help:

https://support.apple.com/sr-rs/guide/mac-help/mchlp15236/mac
https://www.macrumors.com/how-to/files-folders-tags-macos/


Comments

When MuseScore saves a file it indeed saves a temporary copy and then renames that to the original filename to minimize the risk of file corruption during interrupted saves.
As you're effectively getting a new file this'd likely explain why you're tags are "disappearing".

I'm not sure whether the file libraries (from Qt) in use have the capability of managing/copying those metadata tags, which are possibly even stored in a different location from the file (within .DS_Store) and/or on the so-called "Extended Attributes" of the file.

In reply to by jeetee

Thanks for the reply.

Yea, the simplest solution I can think of is to copy the existing file using filesystem commands (which will preserve metadata), empty out the (MuseScore) contents, and then start writing the new contents in its place.

This could be buggy in that metadata changes that happen while the file is open will get lost. So in that case, you could reverse the sequence: write the new data into a truly new file (the way you do today), and then only do the file copy when you’re saving.

I’m wondering what other metadata is being lost. On the Mac, it may include spotlight search terms, extended permissions attributes…

Do you still have an unanswered question? Please log in first to post your question.