Aggiunta la possibilita' di saltare i files con flag oltre 10000
Significa aggiorna solo il tracciato.Riportata anche su R9604. git-svn-id: svn://10.65.10.50/trunk@3682 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ab005b9443
commit
7d7ba87420
113
ba/ba1100.cpp
113
ba/ba1100.cpp
@ -657,6 +657,10 @@ void TManutenzione_app::delete_riga ()
|
|||||||
|
|
||||||
void TManutenzione_app::update_dir()
|
void TManutenzione_app::update_dir()
|
||||||
{
|
{
|
||||||
|
// Particolare significato dei flags oltre i 10000:
|
||||||
|
// trattasi di files PRASSI, (ad esempio i cespiti) che da noi non vengono toccati,
|
||||||
|
// in modo da evitare colpe inutili. Noi aggiorniamo solo i tracciati su dir e trc,
|
||||||
|
// ma il file fisico manco lo tocchiamo!!
|
||||||
const TString pref(prefix().name());
|
const TString pref(prefix().name());
|
||||||
const bool is_com = prefix().is_com();
|
const bool is_com = prefix().is_com();
|
||||||
|
|
||||||
@ -694,7 +698,7 @@ void TManutenzione_app::update_dir()
|
|||||||
|
|
||||||
bool towrite = FALSE;
|
bool towrite = FALSE;
|
||||||
|
|
||||||
// long flags = ds.flags();
|
const long flags = ds.flags();
|
||||||
// word len = ds.len();
|
// word len = ds.len();
|
||||||
// prefix().set(pref);
|
// prefix().set(pref);
|
||||||
d.get(i);
|
d.get(i);
|
||||||
@ -730,13 +734,13 @@ void TManutenzione_app::update_dir()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!yesno_box("Il file %d non puo' essere aperto: errore %d. Continuo?",i,err))
|
if (flags < 10000L && !yesno_box("Il file %d non puo' essere aperto: errore %d. Continuo?",i,err))
|
||||||
stop_run();
|
stop_run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (to_create)
|
if (flags < 10000L && to_create )
|
||||||
{
|
{
|
||||||
remove(d.filename());
|
remove(d.filename());
|
||||||
TToken_string idx_names;
|
TToken_string idx_names;
|
||||||
@ -763,7 +767,7 @@ void TManutenzione_app::update_dir()
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (fexist(fs) && (fd != fs))
|
if (flags < 10000L && fexist(fs) && (fd != fs))
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
TFilename path(fd.path());
|
TFilename path(fd.path());
|
||||||
@ -903,62 +907,73 @@ void TManutenzione_app::convert_dir()
|
|||||||
// prefix().set("");
|
// prefix().set("");
|
||||||
const TTrec & rs = (const TTrec &) _recs[i];
|
const TTrec & rs = (const TTrec &) _recs[i];
|
||||||
const TDir & ds = (const TDir &) _dirs[i];
|
const TDir & ds = (const TDir &) _dirs[i];
|
||||||
|
const long flags = ds.flags();
|
||||||
// prefix().set(pref);
|
// prefix().set(pref);
|
||||||
if (ds.len() > 0)
|
if (ds.len() > 0)
|
||||||
{
|
{
|
||||||
TBaseisamfile b(i);
|
if (flags < 10000L)
|
||||||
const int module = abs((int)ds.flags());
|
|
||||||
int err = b.is_valid();
|
|
||||||
if (err == -60) err=NOERR;
|
|
||||||
d.get(i, _nolock, _nordir, _sysdirop);
|
|
||||||
if (i > 2 && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm())))
|
|
||||||
{
|
|
||||||
if (!yesno_box("Il file %d non puo' essere aperto: errore %d. Continuo?",i,err))
|
|
||||||
stop_run();
|
|
||||||
else continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
TSystemisamfile f(i);
|
|
||||||
|
|
||||||
f.update(rs);
|
|
||||||
if (f.status() == 8) // cio' significa che e' accaduto quasi l'irreparabile...
|
|
||||||
{
|
{
|
||||||
|
TBaseisamfile b(i);
|
||||||
|
const int module = abs((int)ds.flags());
|
||||||
|
int err = b.is_valid();
|
||||||
|
if (err == -60) err=NOERR;
|
||||||
|
d.get(i, _nolock, _nordir, _sysdirop);
|
||||||
|
if (i > 2 && err != NOERR && ((is_com && d.is_com()) || (!is_com && d.is_firm())))
|
||||||
|
{
|
||||||
|
if (!yesno_box("Il file %d non puo' essere aperto: errore %d. Continuo?",i,err))
|
||||||
|
stop_run();
|
||||||
|
else continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
TSystemisamfile f(i);
|
||||||
|
|
||||||
|
f.update(rs);
|
||||||
|
|
||||||
|
if (f.status() == 8) // cio' significa che e' accaduto quasi l'irreparabile...
|
||||||
{
|
{
|
||||||
TLocalisamfile u(LF_USER);
|
|
||||||
u.zero(); u.put("USERNAME","PRASSI");
|
|
||||||
if (u.read() == NOERR)
|
|
||||||
{
|
{
|
||||||
u.zero("AUTSTR");
|
TLocalisamfile u(LF_USER);
|
||||||
u.rewrite();
|
u.zero(); u.put("USERNAME","PRASSI");
|
||||||
|
if (u.read() == NOERR)
|
||||||
|
{
|
||||||
|
u.zero("AUTSTR");
|
||||||
|
u.rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stop_run();
|
||||||
|
}
|
||||||
|
d.get(i, _nolock, _nordir, _sysdirop);
|
||||||
|
bool to_create = (is_com ? d.is_com() : d.is_firm());
|
||||||
|
const bool actual_create = to_create;
|
||||||
|
|
||||||
|
// I files LF_PCON, LF_CAUS, LF_RCAUS, LF_CLIFO, LF_CFVEN, LF_INDSPED
|
||||||
|
// vanno creati comunque nel direttorio COM, vuoti, (se non esistono gia').
|
||||||
|
if (is_com && !to_create)
|
||||||
|
if (i == LF_INDSP || i == LF_CLIFO ||
|
||||||
|
i == LF_PCON || i == LF_CAUSALI || i == LF_RCAUSALI)
|
||||||
|
to_create = TRUE;
|
||||||
|
|
||||||
|
if (flags < 10000L && to_create && has_module(module, CHK_DONGLE))
|
||||||
|
{
|
||||||
|
d.get(i);
|
||||||
|
TFilename s(d.filename());
|
||||||
|
if (!fexist(s))
|
||||||
|
{
|
||||||
|
TSystemisamfile f(i);
|
||||||
|
set_autoload_new_files(actual_create);
|
||||||
|
f.build(10L);
|
||||||
|
set_autoload_new_files(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stop_run();
|
|
||||||
}
|
}
|
||||||
d.get(i, _nolock, _nordir, _sysdirop);
|
else // altrimenti se i flags sono oltre i fatidici 10000...
|
||||||
bool to_create = (is_com ? d.is_com() : d.is_firm());
|
|
||||||
const bool actual_create = to_create;
|
|
||||||
|
|
||||||
// I files LF_PCON, LF_CAUS, LF_RCAUS, LF_CLIFO, LF_CFVEN, LF_INDSPED
|
|
||||||
// vanno creati comunque nel direttorio COM, vuoti, (se non esistono gia').
|
|
||||||
if (is_com && !to_create)
|
|
||||||
if (i == LF_INDSP || i == LF_CLIFO ||
|
|
||||||
i == LF_PCON || i == LF_CAUSALI || i == LF_RCAUSALI)
|
|
||||||
to_create = TRUE;
|
|
||||||
|
|
||||||
if (to_create && has_module(module, CHK_DONGLE))
|
|
||||||
{
|
{
|
||||||
d.get(i);
|
TTrec r(rs);
|
||||||
TFilename s(d.filename());
|
|
||||||
if (!fexist(s))
|
r.put(i);
|
||||||
{
|
}
|
||||||
TSystemisamfile f(i);
|
|
||||||
set_autoload_new_files(actual_create);
|
|
||||||
f.build(10L);
|
|
||||||
set_autoload_new_files(TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else // altrimenti se la dimensione del tracciato e' zero...
|
||||||
{
|
{
|
||||||
TTrec r(rs);
|
TTrec r(rs);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user