Corretto errore MI3158. Modificata scrittura sui dischi di backup (ora
il file viene troncato con una chsize). git-svn-id: svn://10.65.10.50/trunk@1630 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d7f4126c1f
commit
3aa8bbbf81
@ -183,6 +183,7 @@ bool TArchive::fsplit(const char* filename, char floppy, const char* desc) const
|
|||||||
setvbuf(i, NULL, _IOFBF, BUFSIZE);
|
setvbuf(i, NULL, _IOFBF, BUFSIZE);
|
||||||
|
|
||||||
const long tot = fsize(i);
|
const long tot = fsize(i);
|
||||||
|
long scritti=0;
|
||||||
|
|
||||||
TFilename work;
|
TFilename work;
|
||||||
work << floppy << ":/" << from.name(); // File su dischetto
|
work << floppy << ":/" << from.name(); // File su dischetto
|
||||||
@ -205,7 +206,13 @@ bool TArchive::fsplit(const char* filename, char floppy, const char* desc) const
|
|||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
if (o != NULL) fclose(o);
|
|
||||||
|
if (o != NULL)
|
||||||
|
{
|
||||||
|
chsize(fileno(o),scritti); // Must truncate output file or some information will be rewritten on next disk!
|
||||||
|
scritti = 0; // Reset count bytes written to disk.
|
||||||
|
fclose(o);
|
||||||
|
}
|
||||||
o = ask_disk(work, ++disk, floppy, FALSE);
|
o = ask_disk(work, ++disk, floppy, FALSE);
|
||||||
ok = o != NULL;
|
ok = o != NULL;
|
||||||
if (ok)
|
if (ok)
|
||||||
@ -240,9 +247,12 @@ bool TArchive::fsplit(const char* filename, char floppy, const char* desc) const
|
|||||||
|
|
||||||
ok = (letti > 0) ? (fwrite((char*)(const char*)buffer, letti, 1, o) == 1) : TRUE;
|
ok = (letti > 0) ? (fwrite((char*)(const char*)buffer, letti, 1, o) == 1) : TRUE;
|
||||||
if (!ok) error_box("Impossibile scrivere i dati sul dischetto");
|
if (!ok) error_box("Impossibile scrivere i dati sul dischetto");
|
||||||
|
else
|
||||||
|
scritti +=letti;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
scritti += letti;
|
||||||
w.addstatus(letti);
|
w.addstatus(letti);
|
||||||
if (ok)
|
if (ok)
|
||||||
ok = !w.iscancelled();
|
ok = !w.iscancelled();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user