godot
godot copied to clipboard
Script content gets deleted when running game with low hard drive space
Godot version:
v3.2.2 stable official
OS/device including version:
macbook pro retina 13 inch late 2013, macOS 10.12.6
Issue description:
Trying to run game using cmd-B an error appeared with saving and the contents of on of the scripts was completely deleted. The script file still remains but without any code in it.
Steps to reproduce: When on very low hard drive space. Try to simply run a game and on some error to save the contents of a file could be overwritten with an empty file of the same name.
Minimal reproduction project:
I'm not sure if we can do much about this, other than displaying a dialog in the editor if the partition the project is stored on has very little space remaining (< 500 MB).
In general, it's not a good idea to leave your boot partition with less than 500 MB remaining. Your PC might become unbootable the next time you try to boot it…
Yep, Godot ate my files. This has happened to me twice (and never again), the second time it ate a large .tscn file and a .gd file, making them 0 kb. I even tried data recovery software as my backups were a week old.
I strongly suggest when saving that Godot should detect the hard drive space and PREVENT saving if there's no space. Tell the user to go get some space first.
This issue has some seriously catastrophic consequences.
Maybe write to another file first and then rename? I believe that's the standard solution. Seems super dangerous otherwise.
Closing in favor of https://github.com/godotengine/godot/issues/45354, which has more information about the issue at hand.