Comment 26 for bug 679917

Revision history for this message
rew (r-e-wolff) wrote :

Thomas, you have to learn to distinguish between a work-in-progress patch and a final "suggested fix" patch.

Yes, I'm sure that on Unix you can keep an open filedescriptor to a file and rename it. The common way to prevent temporary files from cluttering the filesystem is to open the temporary file, and then delete it. Now when the program exits (clean or otherwise) it is the OS'es responsibility to clean up the file now that there are no longer any references to it.

Yes, now that we're talking autosaves, we can think about backups too. Maybe we can solve two issues in one go.

Yes, my patch doesn't yet implement any of my suggested backup ideas. The patch proves that making hugin do an autosave can be done in less than 20 lines-of-code. Of course before the patch goes final, the interval will be increased. But we're not that far yet. So, it provides good debugging opportunities if it triggers the autosave every 10 seconds, as opposed to every 10 minutes.

If we've decided that history/backup might be useful, and if the autosave "fits in" with the naming convention, then maybe we can unify these. So whereas "$HOME/.hugin-autosave" is a Unix-only filename for the auto-save, if we'd use the name of the project we'd immediately have a valid name on whatever OS this runs on. "untitled-autosave.pto" should work on most OSes too.