From 315d8bfd8df561b5e07646caf186ff65335ba5ef Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Tue, 17 Mar 2009 20:45:57 +0000 Subject: [PATCH] Temp streams are removed always when same file is requested to be saved pmo-trunk-r8129 --- src/modest-utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modest-utils.c b/src/modest-utils.c index eb21481..33b5a04 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -155,6 +155,12 @@ modest_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base, } filepath = g_strconcat (tmpdir, "/", orig_name, NULL); + + /* if file exists, first we try to remove it */ + if (modest_utils_file_exists (filepath)) { + g_unlink (filepath); + } + /* don't overwrite if it already exists, even if it is writable */ if (modest_utils_file_exists (filepath)) { if (path!=NULL) { -- 1.7.9.5