Bug 120313

Summary: Delete backup files after closing the application
Product: [Unmaintained] kdelibs Reporter: Jakob Petsovits <jpetso>
Component: generalAssignee: Stephan Kulow <coolo>
Status: RESOLVED UNMAINTAINED    
Severity: wishlist CC: faure, winter
Priority: NOR    
Version: 3.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jakob Petsovits 2006-01-17 15:14:28 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Ubuntu Packages
OS:                Linux

As clearly seen in Bug 3212, there is the need for backup files not to show up when browsing, as they clutter the file list. On the other hand, they should be obvious to find when the need is there to restore them.

I propose to only have backup files while the application is running. As their main reason for existance is to be able to restore files after an application has crashed, its a minor advantage to have them permanently.

I imagine an application (say, Kate) to create files named e.g. "filename.txt~" and indexes them in a config file while I am editing the file. If the the file or the application is closed normally, this file and the config entry are deleted and the directory is clean again. If the application crashes, the file remains and on its next start, the application checks for existing config entries which indicate backup files that should be restored.

That way, the application can (either automatically or by asking the user through a dialog) reload the backup file, maybe after renaming it to something steady like "filename.txt.restored", or to the original filename if the user agrees with that. The remaining backup files are then deleted, or respectively renewed to backup the restored file again.

If users really close the application normally (after getting asked if they want to save it or not, in case they haven't done so), I don't see why there should still be a backup file left.
Comment 1 David Faure 2008-06-26 18:06:30 UTC
This is indeed the way KOffice autosave files work.

However backup files also serve another purpose: what if you delete the file in a file manager by mistake (or overwrite it with another file, etc. etc.)? The backup file can then be used as fallback to recover your document, although a slightly older version of it.
Comment 2 Stephan Kulow 2023-01-18 10:38:54 UTC
Closing old bugs