GNOME Bugzilla – Bug 687344
Temp file used by g_file_replace is leaked if the operation fails or is cancelled
Last modified: 2012-11-02 12:31:46 UTC
Created attachment 227804 [details] [review] Patch I've noticed that I have a lot of .goutputstream- files in a directory where a file is replaced. The problem is that when replace is cancelled before the rename, the temp file is no deleted.
> Call g_unlink on the temp file when the output stream close finishes due > to an error or it's cancelled. If it was cancelled after the rename, the > temp file won't exist and g_unlink will fail silently. That's a tiny bit unsafe... theoretically, another GFile op could have ended up getting the same file name after the first temp file was renamed... also, dup *** This bug has been marked as a duplicate of bug 629301 ***