Corretta le'leiminazione dei files di descrizione del direttorio

e del livello.


git-svn-id: svn://10.65.10.50/trunk@3527 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
angelo 1996-09-05 16:15:50 +00:00
parent 4229abb2c4
commit 1b8778a2dc

View File

@ -411,7 +411,15 @@ void TManutenzione_app::dump_trc(const char * dir, const bool des_too, const lon
{
TDir d;
d.get(LF_DIR);
const int items = d.eod();
const int items = (int) d.eod();
const long flags = d.flags(); // livello archivi
TFilename fn(dir);
fn << "/level.dir";
{
ofstream of(fn);
of << flags << '\n';
}
TString s("Scarico dei tracciati standard in ");
s << dir;
TProgind p(items ? items : 1, s, FALSE, TRUE, 70);
@ -435,7 +443,7 @@ void TManutenzione_app::dump_trc(const char * dir, const bool des_too, const lon
TConfig conf_des(descfname,DESCPAR);
if (des_too) rc.set_des(&conf_des);
TFilename fn(dir);
fn = dir;
fn << "/f";fn << i;
fn.ext("trr");
ofstream out(fn);
@ -976,17 +984,31 @@ void TManutenzione_app::load_des()
TDir d;
TTrec r;
d.get(LF_DIR);
d.get(LF_DIR,_nolock, _nordir,_sysdirop);
int items = (int)d.eod();
long flags = d.flags();
const bool standard = pref.empty();
if (standard) // carica eventuali nuove descrizioni
if (standard) // carica eventuali nuove descrizioni ed il nuovo livello archivi
{
// Cerca in RECDESC i files f[nnn].dir, la cui numerazione inizia da items+1
TFilename fn;
TDir td;
TTrec tr;
tr.zero();
fn << DESCDIR << "/level.dir";
if (fexist(fn))
{
{
long fl;
ifstream level(fn);
level >> fl;
if (fl > flags) flags = fl;
}
unlink(fn);
}
for (int xf=items+1;;xf++)
{
fn = DESCDIR;
@ -996,15 +1018,19 @@ void TManutenzione_app::load_des()
break;
// altrimenti lo carica nel direttorio standard,
// aggiungendo un tracciato vuoto
ifstream in(fn);
in >> td;
td.put(xf,_nordir,_sysdirop);
tr.put(xf);
{
ifstream in(fn);
in >> td;
td.put(xf,_nordir,_sysdirop);
tr.put(xf);
}
unlink(fn);
}
xf--;
d.eod() = (long)xf;
d.put(LF_DIR);
d.eox() = (long)xf;
d.flags() = flags;
d.put(LF_DIR,_nordir,_sysdirop);
}
items = (int) d.eod();