diff --git a/include/utility.cpp b/include/utility.cpp index 6dc494459..93c8a7e65 100755 --- a/include/utility.cpp +++ b/include/utility.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -36,11 +37,13 @@ bool fcopy( if (i == NULL) return error_box(FR("Impossibile leggere il file %s\nda copiare in %s"), orig, dest); + if (!append) + ::remove(dest); FILE* o = fopen(dest, wflag); if (o == NULL) { fclose(i); - return error_box(FR("Impossibile creare il file %s\nper copiare il file %s"), dest, orig); + return error_box(FR("Impossibile creare il file '%s' (%s)\nper copiare il file '%s'\nErrore %d"), dest, wflag, orig, errno); } const int size = 16*1024;