When the partition is full, attempting to save a file in Mousepad results in a partial file loss. Mousepad version : 0.4.2 System : Ubuntu Linux 20.04 LTS To reproduce : 1. Fill some partition until there is no space left on it. For example : fallocate -l 100G bigfile 2. Edit a text file located in the full partition and add some character to it 3. Try to save the file. Mousepad says there is no space left on device. Exit Mousepad. 4. The edited file size is now less than the original and the file was truncated, with a loss of data
What is the actual/complete error message you receive? Does it mark the file as having been saved, or does it keep it as dirty so it prompts you to save it when exiting?
The dialog says: "Failed to save the document. No space left on device. And there is a Close button. Then when exiting Mousepad, there is a dialog that says: "Do you want to save the changes before closing?" with three options: Don't save, Cancel and Save. Clicking on the "Don't save" option results in a truncated file.
Ok, that's not too bad then since it prompts again to save when exiting. Perhaps the error message should be more explicit, like: > Failed while saving the document. No space left on device. > File on disk may be truncated or corrupted, make sure to save > the document to a different location to avoid data loss.
Yes, a more explicit message would be better. But why not checking the available space (using statvfs() for example) before attempting to save the file?
Is this issue related to or a duplicate of bug 8754?
Yes, it seems to me that's the same problem.
*** This bug has been marked as a duplicate of bug 8754 ***