Patch level : 10.0 200
Files correlati : ba1.exe Ricompilazione Demo : [ ] Commento : 0001036: installazione cd patch 180 Installando ex novo ed indicando una società esistente di dati su una cartella diversa viene segnalato l'errore ba1.exe in fase di conversione archivi, richiamando da manutenzione archivi la conversione vengono generati gli errori allegati. Nell'area ftp di Aga, cartella Ilaria allego l'area dati SIDA per il test. git-svn-id: svn://10.65.10.50/trunk@17973 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
a8c9e7810c
commit
97cf100315
107
ba/ba1100.cpp
107
ba/ba1100.cpp
@ -689,7 +689,8 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
||||
TFilename f_name(d.name());
|
||||
f_name.ext("dbf");
|
||||
|
||||
if (!f_name.exist()) f.build(eox);
|
||||
if (!f_name.exist())
|
||||
f.build(eox);
|
||||
|
||||
_browse->dir().get(logicnum, _nolock, _nordir, _sysdirop);
|
||||
}
|
||||
@ -800,38 +801,38 @@ bool TManutenzione_app::recover(TSystemisamfile& f, int err)
|
||||
|
||||
void TManutenzione_app::repair_file(int i)
|
||||
{
|
||||
TString s(_MAX_PATH);
|
||||
TString s(_MAX_PATH + 50); // Messaggio di log
|
||||
|
||||
TDir d(i);
|
||||
const char* n = d.filename();
|
||||
|
||||
if (d.eod() == 0)
|
||||
{
|
||||
TFilename n(d.filename());
|
||||
|
||||
save_file(n);
|
||||
remove(n);
|
||||
n.ext("cdx"); remove(n);
|
||||
n.ext("fpt"); remove(n);
|
||||
s.format(FR("File n. %d - %s : eliminato file errato"), i, (const char *)d.filename());
|
||||
|
||||
TToken_string names; get_table_names(i, names, 0xF);
|
||||
FOR_EACH_TOKEN(names, name)
|
||||
xvt_fsys_remove_file(name);
|
||||
|
||||
s.format(FR("File n. %d - %s : eliminato file errato"), i, n);
|
||||
write_log(s, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
d.get(i, _lock, _nordir, _sysdirop);
|
||||
TFilename n(d.filename());
|
||||
save_file(n);
|
||||
TExternisamfile ef(d.filename());
|
||||
TExternisamfile ef(n);
|
||||
|
||||
const RecDes& rd = ef.curr().rec_des();
|
||||
TTrec rec; rec.get(i);
|
||||
const int oldreclen = rec.len();
|
||||
const int recsize = sizeof(RecDes);
|
||||
rec.rec() = rd;
|
||||
rec.put(i);
|
||||
|
||||
const int reclen = rec.len();
|
||||
d.set_len(reclen);
|
||||
d.put(i, _nordir, _sysdirop);
|
||||
s.format(FR("File n. %d - %s : corretto tracciato da %d a %d bytes"), i, (const char *)d.filename(), oldreclen, reclen);
|
||||
s.format(FR("File n. %d - %s : corretto tracciato da %d a %d bytes"), i, n, oldreclen, reclen);
|
||||
write_log(s, 1);
|
||||
}
|
||||
}
|
||||
@ -849,18 +850,18 @@ void TManutenzione_app::update_dir()
|
||||
// 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 bool is_com = prefix().is_com();
|
||||
|
||||
if (prefix().get_codditta() <= _history_firm)
|
||||
return;
|
||||
|
||||
const TString pref(prefix().name());
|
||||
const bool is_com = prefix().is_com();
|
||||
const int last_new_item = _dirs.last(); //quale è il numero dell'ultimo file nuovo?
|
||||
|
||||
TDir d(LF_DIR); // equivale a d.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
const int last_curr_item = (int)d.eod(); //quale è il numero dell'ultimo file attualmente presente
|
||||
|
||||
const int update_items = (last_new_item < last_curr_item) ? last_new_item : last_curr_item;
|
||||
safely_close_closeable_isamfiles(); // Serve a premettere la chiamata ad fsize() in sicurezza
|
||||
|
||||
TString prompt(128);
|
||||
if (is_com)
|
||||
@ -869,13 +870,12 @@ void TManutenzione_app::update_dir()
|
||||
prompt << TR("Aggiornamento ditta") << ' ' << atol(pref) << '.';
|
||||
|
||||
TProgind p(update_items ? update_items : 1, prompt, false, true);
|
||||
p.setstatus(1);
|
||||
|
||||
int i;
|
||||
|
||||
for (i = LF_USER; i <= update_items; i++)
|
||||
{
|
||||
p.addstatus(1);
|
||||
if (!p.setstatus(i))
|
||||
break;
|
||||
|
||||
const TDir & ds = (const TDir &) _dirs[i];
|
||||
const bool is_firm = ds.is_firm();
|
||||
@ -919,48 +919,42 @@ void TManutenzione_app::update_dir()
|
||||
{
|
||||
if (old_is_firm && !moveable_file(i) && d.eod() == 0L)
|
||||
{
|
||||
TFilename n(d.filename());
|
||||
const char* n = d.filename();
|
||||
save_file(n);
|
||||
remove(n);
|
||||
n.ext("cdx"); remove(n);
|
||||
n.ext("fpt"); remove(n);
|
||||
|
||||
TToken_string names; get_table_names(i, names, 0xF);
|
||||
FOR_EACH_TOKEN(names, name)
|
||||
xvt_fsys_remove_file(name);
|
||||
|
||||
TString msg(_MAX_PATH);
|
||||
msg.format(FR("File n. %d - %s : eliminato file non utilizzato"), i, (const char *)d.filename());
|
||||
write_log(msg, 1);
|
||||
}
|
||||
}
|
||||
if (i > 2 && is_firm == old_is_firm)
|
||||
if (i > LF_USER && is_firm == old_is_firm)
|
||||
{
|
||||
FILE * f = fopen(fs, "r");
|
||||
if (f != NULL)
|
||||
{
|
||||
fseek(f, 0L, SEEK_END);
|
||||
const long size = ftell(f);
|
||||
fclose(f);
|
||||
|
||||
const long size = fsize(fs);
|
||||
if (flags < 10000L && size > 0L && d.len() > 0)
|
||||
{
|
||||
TSystemisamfile b(i);
|
||||
int err = b.is_valid(true);
|
||||
if ((err == _istrcerr) && (d.eod() == 0) && (fsize(d.filename()) < 4096))
|
||||
if ((err == _istrcerr || err == _ispatherr) && (d.eod() == 0) && (size < 4096))
|
||||
{
|
||||
bool kill = true;
|
||||
//controllo solo all'aga
|
||||
if (is_power_station())
|
||||
kill = yesno_box(FR("Il tracciato record del file %d e' incoerente:\nSi desidera eliminare il file vuoto %s?"), i, d.filename());
|
||||
kill = yesno_box(FR("Il tracciato record del file %d e' incoerente:\nSi desidera eliminare il file vuoto %s?"), i, (const char*)fs);
|
||||
if (kill)
|
||||
{
|
||||
TFilename n(d.filename());
|
||||
save_file(n);
|
||||
remove(n);
|
||||
n.ext("cdx"); remove(n);
|
||||
n.ext("fpt"); remove(n);
|
||||
TToken_string names; get_table_names(i, names, 0xF);
|
||||
FOR_EACH_TOKEN(names, name)
|
||||
xvt_fsys_remove_file(name);
|
||||
|
||||
err = NOERR;
|
||||
// se si decide di eliminare il file con tracciato del cazzo deve tenerne traccia nel log (nel caso di utonti..
|
||||
//..è sempre così, perchè kill è sempre true)
|
||||
TString msg;
|
||||
msg.format(TR("Eliminato il file %d avente tracciato record incoerente"), n);
|
||||
msg.format(TR("Eliminato il file %d avente tracciato record incoerente"), i);
|
||||
write_log(msg, 2);
|
||||
}
|
||||
} //if((err==_istrcerr...
|
||||
@ -987,20 +981,17 @@ void TManutenzione_app::update_dir()
|
||||
{
|
||||
if (flags < 10000L && to_create)
|
||||
{
|
||||
xvt_fsys_remove_file(d.filename());
|
||||
TToken_string idx_names;
|
||||
get_idx_names(i, idx_names);
|
||||
FOR_EACH_TOKEN(idx_names, idx_name)
|
||||
xvt_fsys_remove_file(idx_name);
|
||||
TToken_string names;
|
||||
get_table_names(i, names, 0xF);
|
||||
FOR_EACH_TOKEN(names, name)
|
||||
xvt_fsys_remove_file(name);
|
||||
d.get(i, _nolock, _nordir, _sysdirop);
|
||||
d.set_eod(0);
|
||||
d.set_eox(0);
|
||||
d.reset_eox();
|
||||
d.put(i, _nordir, _sysdirop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
d.get(i, _nolock, _nordir, _sysdirop);
|
||||
|
||||
bool cmn_file = false;
|
||||
@ -1030,21 +1021,13 @@ void TManutenzione_app::update_dir()
|
||||
|
||||
if (fs == fn)
|
||||
{
|
||||
TTrec wrs;
|
||||
TTrec wrd;
|
||||
|
||||
wrs.get(i);
|
||||
|
||||
wrd.get(j); // A cosa ca$$o serve ...
|
||||
wrd = wrs; // ... visto che poi lo sbatto via?
|
||||
wrd.set_num(j);
|
||||
|
||||
TTrec wrs(i), wrd(j);
|
||||
wrd = wrs; wrd.set_num(j); // Copia e rinumera
|
||||
wrd.put(j);
|
||||
wrs.zero();
|
||||
wrs.put(i);
|
||||
TDir wds(i);
|
||||
TDir wdd(j);
|
||||
|
||||
TDir wds(i), wdd(j);
|
||||
wdd.set(wds.name(), wds.eod(), wds.flags(), wds.des(), wds.expr());
|
||||
wdd.set_eox(wds.eox());
|
||||
wdd.set_len(wrd.len());
|
||||
@ -1068,7 +1051,7 @@ void TManutenzione_app::update_dir()
|
||||
{
|
||||
TToken_string ts(10),td(10);
|
||||
td.cut(0);
|
||||
get_idx_names(i,ts); // Get index names of current file in current dir
|
||||
get_table_names(i,ts,0x2); // Get index names of current file in current dir
|
||||
for (int j=1; j<= ts.items() && ok; j++)
|
||||
{
|
||||
const TFilename fsi(ts.get());
|
||||
@ -1168,11 +1151,9 @@ void TManutenzione_app::update_dir()
|
||||
//aggiornatore degli EOX EOD ecc. dei files nuovi
|
||||
for (i = last_curr_item + 1; i <= last_new_item; i++)
|
||||
{
|
||||
TDir d1((TDir &) _dirs[i]);
|
||||
|
||||
TDir d1((const TDir&)_dirs[i]);
|
||||
d1.set_len(0);
|
||||
d1.set_eox(0);
|
||||
d1.set_eod(0);
|
||||
d1.reset_eox();
|
||||
d1.set_flags(0);
|
||||
d1.put(i, _nordir, _sysdirop); //scrive su dir.gen il nuovo file aggiunto (mettendo numero,eox,eod,flags)
|
||||
}
|
||||
@ -1180,8 +1161,6 @@ void TManutenzione_app::update_dir()
|
||||
//allinea i valori di eox ed eod (eox non può mai essere < eod!)
|
||||
d.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||
d.set_eod(last_new_item);
|
||||
if (d.eox() < d.eod())
|
||||
d.set_eox(d.eod());
|
||||
d.put(LF_DIR, _nordir, _sysdirop);
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,16 @@ BEGIN
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -25 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_NULL 2 2
|
||||
BEGIN
|
||||
PROMPT -1 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_IMPORT 10 2
|
||||
BEGIN
|
||||
PROMPT -45 -1 "~Importa"
|
||||
@ -26,15 +36,7 @@ BEGIN
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
BUTTON DLG_PRINT 10 2
|
||||
BEGIN
|
||||
PROMPT -25 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -55 -1 ""
|
||||
END
|
||||
#include <helpbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
|
@ -31,7 +31,7 @@ TDir_sheet::TDir_sheet(const char* title, bool superprassi, const char* colonne)
|
||||
: TSheet(0, 0, 0, 0, title, colonne, superprassi ? 0xC : 0x8)
|
||||
{
|
||||
add_button(DLG_PRINT, TR("Tracciati"), K_F3, BMP_PRINT);
|
||||
add_button(-1, "", 0, 1); // Separatore
|
||||
add_button(DLG_NULL, "", 0); // Separatore
|
||||
|
||||
if (superprassi)
|
||||
{
|
||||
@ -39,7 +39,7 @@ TDir_sheet::TDir_sheet(const char* title, bool superprassi, const char* colonne)
|
||||
add_button(DLG_CONVERT, TR("Conversione"), K_F7, 156);
|
||||
if (is_power_station())
|
||||
add_button(DLG_ADDFILE, TR("Nuovo file"), K_F8, BMP_NEWREC);
|
||||
add_button(-1, "", 0, 1); // Separatore
|
||||
add_button(DLG_NULL, "", 0); // Separatore
|
||||
}
|
||||
|
||||
add_button(DLG_INFO, TR("Info"), K_F2, BMP_INFO);
|
||||
@ -173,12 +173,13 @@ bool TRec_sheet::key_notify(TSheet_field& f, int r, KEY k)
|
||||
if (k == K_INS)
|
||||
{
|
||||
const int items = f.items();
|
||||
if (items >= 8) return FALSE;
|
||||
if (items >= 8)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if (k == K_CTRL + K_INS)
|
||||
f.enable_cell(r, 1, r > 0);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void TRec_sheet::save_desc()
|
||||
@ -410,7 +411,8 @@ void TRec_sheet::edit()
|
||||
}
|
||||
}
|
||||
break;
|
||||
default: break;
|
||||
default:
|
||||
return; // K_QUIT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,8 @@ void TPackFiles_application::build_sheet()
|
||||
void TPackFiles_application::search_blanks(TSystemisamfile& f)
|
||||
{
|
||||
// Scorre il file corrente per record cancellando eventuali record vuoti/blank
|
||||
if (f.open(_excllock, true))
|
||||
const TIsam_handle h = f.open(_excllock, true);
|
||||
if (h >= 0)
|
||||
{
|
||||
const long records = f.items();
|
||||
TString k;
|
||||
@ -119,6 +120,7 @@ void TPackFiles_application::search_blanks(TSystemisamfile& f)
|
||||
void TPackFiles_application::pack_all()
|
||||
{
|
||||
TProgind p(_selsheet->checked(), TR("Compattazione in corso..."), true, true);
|
||||
safely_close_closeable_isamfiles();
|
||||
FOR_EACH_CHECKED_ROW(*_selsheet, k, row)
|
||||
{
|
||||
if (!p.addstatus(1))
|
||||
|
@ -345,10 +345,7 @@ bool TInstaller_mask::autoload()
|
||||
TString_array& mask_rows = rows_array();
|
||||
|
||||
TString http_server;
|
||||
TFilename http_path;
|
||||
|
||||
TFilename path;
|
||||
TFilename ininame;
|
||||
TFilename http_path, path, ininame;
|
||||
|
||||
//controla se si e' scelto un path di installazione internet o da disco
|
||||
const bool internet = get_patches_path(path);
|
||||
@ -357,21 +354,15 @@ bool TInstaller_mask::autoload()
|
||||
{
|
||||
parse_internet_path(http_server, http_path); //controlla il path internet scritto nel campo sulla maschera
|
||||
|
||||
make_dir(path); //crea la directory temporanaea di installazione dove depositare e scompattare gli zip
|
||||
//se si ritrova dei vecchi file nella directory temporanea, la pulisce per evitare casini
|
||||
ininame = path; ininame.add("*.*");
|
||||
TString_array list;
|
||||
::list_files(ininame, list);
|
||||
FOR_EACH_ARRAY_ROW(list, i, row)
|
||||
xvt_fsys_remove_file(*row);
|
||||
|
||||
ininame = path;
|
||||
ininame.add(TInstall_ini::default_name());
|
||||
|
||||
//se si ritrova dei vecchi .ini nella directory temporanea->pulisce la directory temporanea x evitare casini
|
||||
if (ininame.exist()) //&& yesno_box(TR("Si desidera svuotare la cache dei files scaricati dal sito?"))) domanda del cazzo!
|
||||
{
|
||||
TString_array list;
|
||||
TFilename name = path; name.add("*.*");
|
||||
::list_files(name, list);
|
||||
|
||||
FOR_EACH_ARRAY_ROW(list, i, row)
|
||||
::remove(*row);
|
||||
}
|
||||
if (!ininame.exist())
|
||||
{
|
||||
TFilename remote_ini = http_path;
|
||||
@ -1177,15 +1168,15 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
bool TInstaller_mask::get_patches_path(TFilename& path) const
|
||||
{
|
||||
const TEdit_field& www = efield(F_WEB);
|
||||
path = get(F_WEB);
|
||||
path = www.get();
|
||||
if (www.active() && path.full() && is_internet_path(path))
|
||||
{
|
||||
path.tempdir();
|
||||
path.add("www");
|
||||
make_dir(path); //crea la directory temporanaea di installazione dove depositare e scompattare gli zip
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -287,7 +287,7 @@ void TSelector_app::save_cursor_key(TCursor& cur, TConfig& ini)
|
||||
TString16 para; para << curr.num();
|
||||
ini.set_paragraph(para);
|
||||
|
||||
const RecDes& rd = *curr.rec_des();
|
||||
const RecDes& rd = curr.rec_des();
|
||||
const KeyDes& kd = rd.Ky[0];
|
||||
for (int i = 0; i < kd.NkFields; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user