X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-utils.c;h=33b5a049def867e02bbb09ccd20a96f367a821db;hb=92572a5a8545b048ada98f4ad6f9573f900cf29d;hp=eb214811a824109053920a9621960be4dfe5f10b;hpb=44143a5711bcd5af30f336d19d472077d7494f3a;p=modest 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) {