Correzione errori MI3140 MI3137 e MI3136
git-svn-id: svn://10.65.10.50/trunk@1505 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
35eb7a757b
commit
8dccb48bae
@ -4,6 +4,7 @@
|
||||
#include <mask.h>
|
||||
#include <prefix.h>
|
||||
#include <urldefid.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "cg4.h"
|
||||
#include "cg4200.h"
|
||||
@ -27,21 +28,39 @@ public:
|
||||
};
|
||||
|
||||
bool TCopia_archivi::copyfile(int logicnum, long from, long to)
|
||||
{
|
||||
if (from > 0) set_firm(from);
|
||||
{
|
||||
TDir dir;
|
||||
|
||||
set_firm(to);
|
||||
dir.get(logicnum, _nolock, _nordir, _sysdirop);
|
||||
if (dir.is_com())
|
||||
{
|
||||
dir.get(logicnum);
|
||||
return error_box("Non posso copiare su un'archivio comune : ditta %ld - archivio %s", to, dir.name());
|
||||
}
|
||||
if (from > 0) set_firm(from);
|
||||
else prefix().set("com");
|
||||
dir.get(logicnum);
|
||||
|
||||
if (!fexist(dir.name()))
|
||||
{
|
||||
if (from > 0)
|
||||
return error_box("Non esiste il file sorgente : ditta %ld - %s", from, dir.name());
|
||||
else
|
||||
return error_box("Non esiste il file sorgente : archivi comuni - %s", dir.name());
|
||||
}
|
||||
TSystemisamfile file(logicnum);
|
||||
TFilename t; t.tempdir(); t << "/tr" << logicnum;
|
||||
|
||||
if (file.dump(t) != NOERR)
|
||||
return error_box("Impossibile leggere i dati da copiare errore n. %d", file.status());
|
||||
set_firm(to);
|
||||
|
||||
TFilename s; s.tempdir(); s << "/sv" << logicnum;
|
||||
|
||||
if (file.dump(s) != NOERR)
|
||||
return error_box("Impossibile salvare i dati originali errore n. %d", file.status());
|
||||
|
||||
TDir dir;
|
||||
|
||||
dir.get(logicnum, _lock, _nordir, _sysdirop);
|
||||
dir.eod() = 0L;
|
||||
|
Loading…
x
Reference in New Issue
Block a user