Put the backup file in a separate folder
Type
Functional
Frequency
Many
Severity
S5 - Suggestion
Status
closed
Regression
No
Workaround
No
Project
The hidden backup files automatically generated when saving are a significant irritant for me, often causing confusion (I can't count the number of times I've attempted to open one of them by mistake instead of the real file).
Please don't tell me to turn off hidden files. I exercise complete control over my system, so of course I have it set to show hidden files, and these things are a significant annoyance. As it is, I spend a lot of time deleting them so they don't cause confusion, thus losing the safety net they are meant to provide. But it's worth it to preserve my workflow.
Surely a good compromise would be to place these hidden backups in a separate folder which the user can control from Preferences | General | Folders.
Fix version
3.5.0
Comments
The backup files are a byproduct of the safe write procedure MuseScore is using:
- write into a temporary file
- rename the original file into the backup file which removes the old backup file
- rename the temporary file into the original file name
MuseScore omits the last step of deleting the backup file as i believe its very useful.
Moving the backup files into separate folders is a bad idea as it makes the whole process
less robust:
- there can be name conflicts
- if the folder is on a different filesystem (disk) then moving (renaming) is not possible, only copying which
can fail for various reasons
You don't want to hear it but the right way is to not show hidden files. For complete control i guess there
is an option in your filebrowser to show all files.
OK, then please allow the user to turn off this function altogether. I'm sure it helps some people, but I save my work often enough that it's not worth the bother for me. I lose a bit of work from a crash every once in a while, but it's very much worth the price.
And no, it is not an option to hide files. Showing them is the only way to have full control over one's system and keep it completely clean.
Why not just set your file browser to only hide files in your scores folder.
Came up several times in the past. Switching backup files off is implemented in https://github.com/musescore/MuseScore/pull/5372
In reply to Came up several times in the… by Jojo-Schmitz
Issue for that PR: #295310: Add an advanced preference option of disabling backup file generation.
In reply to #2 by [DELETED] 3
i can see you need the atomic action (rename) to avoid interruption on saving. But that is only upon saving..
There is no specific reason not to use a separate directory where all temp files reside, and upon saving ename the file there and supsequently move the file to the desired directory. Agreed, there is an interruption sesitive moment between rename and the move, and during the move if the temp directory is not on the same filesystem, but the file is always retrievable.
I'm currently implementing this and it may take some time. My progress can be seen at https://github.com/Howard-C/MuseScore/tree/backup-dir.
Pseudo-code for the actual workflow: (based on Telegram discussion)
The relevant branch has been changed to https://github.com/Howard-C/MuseScore/tree/backup.
EDIT: Now https://github.com/Howard-C/MuseScore/tree/backup-old.
So, this was discussed with the developers and we determined to have an alternative solution. Will be done later. As for this, I don't want to mark as "won't fix" too soon, but it's of high possibility.
the discussed solution of using a hidden '.backup' folder in the score's folder for those backup files is not an entirely different idea, so still covered by this issue, "Put the backup file in a separate folder", it just won't be an arbitrary configurable folder.
In reply to the discussed solution of… by Jojo-Schmitz
True, it's related. But the solution is totally different. Which is to say, the original idea can still be covered with no conflicts. But whether this idea is still valuable depends on user feedback on the alternative solution ;-)
maybe the default location folder should be a hidden .backup, like jojo said? see this for more implementation:
In reply to maybe the default location… by ecstrema
Yeah, it's exactly why the commit your link links to isn't useful anymore.
In reply to the discussed solution of… by Jojo-Schmitz
Agree with Jojo, there is no reason to parametrize that folder.
Using always the same name being a subfolder of the place where you save the score will help to find backup and will solve the two questions around that change:
-no name conflict
-keep atomicity of move rename as move on the same disk is just a rename in file system. The move and rename will be a unique atomic action as desired.
Thanks to the developers for first allowing us to turn this off if desired, and second to have a different folder. Great news on both counts.
See https://github.com/musescore/MuseScore/pull/5380.
Fixed in branch master, commit 8e9b2e5279
_fix #125656: put the backup file in a separate folder
Resolves: https://musescore.org/node/125656.
This isn't the original idea #125656 gives us. However the idea of creating an invisible subfolder named .backup and put the backup file in it does make better sense, so this fix follows it._
Fixed in branch master, commit 8537770c35
_Merge pull request #5380 from Howard-C/backup-folder
[Backup File] fix #125656: put the backup file in a separate folder_
Automatically closed -- issue fixed for 2 weeks with no activity.