diff --git a/ba/ba1200.cpp b/ba/ba1200.cpp index 135af2771..4100f0953 100755 --- a/ba/ba1200.cpp +++ b/ba/ba1200.cpp @@ -24,10 +24,9 @@ public: clock_t TTest_application::start_timer() const { - clock_t t, s = clock(); - do - t = clock(); - while (t == s); + clock_t t = clock(); + while (clock() == t); + t = clock(); return t; } @@ -56,7 +55,8 @@ void TTest_application::test1() } } const clock_t t = clock() - start; - msg.format("%ld records in %ld msec\n%lg records per sec", r, t, 1000.0*r/t); + msg.format("Lettura file comuni\n" + "%ld records in %ld msec\n%lg records per sec", r, t, 1000.0*r/t); message_box(msg); } @@ -81,7 +81,7 @@ void TTest_application::test2() for (tab = 0; tab.pos() < n; ++tab) r++; - msg.format("%ld records %ld msec", r, clock() - start); + msg.format("Lettura cursore comuni\n%ld records %ld msec", r, clock() - start); p.addstatus(1); p.set_text(msg); if (p.iscancelled()) @@ -117,7 +117,7 @@ void TTest_application::test3() for (tab = 0; tab.pos() < n; ++tab) r++; - msg.format("%ld records %ld msec", r, clock() - start); + msg.format("Lettura cursore C.A.P.\n%ld records %ld msec", r, clock() - start); p.addstatus(1); p.set_text(msg); if (p.iscancelled()) diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index d53c387d2..15ef39b66 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -572,6 +572,27 @@ bool TInstaller_mask::is_zip_file(const TFilename& n) const return xvt_str_compare_ignoring_case(ext, "zip") == 0; } +void TInstaller_mask::create_dirs(const char* path) const +{ + TToken_string dirs(path, SLASH); + if (SLASH == '\\') + dirs.replace('/', SLASH); + else + dirs.replace('\\', SLASH); + + // file contains non existent subdir specification ? + TFilename subdir; + for (int c=0; c < dirs.items()-1; c++) + { + subdir.add(dirs.get(c)); + if (subdir.right(1) == ":" ) + subdir << SLASH; + if (!subdir.exist() ) + // build destination directory + make_dir(subdir); + } +} + // sposta il file dal direttorio temporaneo a quello passato come destinazione bool TInstaller_mask::move_file(const TFilename& src, const TFilename& dst) const { @@ -584,20 +605,7 @@ bool TInstaller_mask::move_file(const TFilename& src, const TFilename& dst) cons } if (!dest.exist()) - { - TToken_string dirs(dest.path(), SLASH); - // file contains non existent subdir specification ? - TFilename subdir; - for (int c=0; c < dirs.items()-1; c++) - { - subdir.add(dirs.get(c)); - if (subdir.right(1) == ":" ) - subdir << SLASH; - if (!subdir.exist() ) - // build destination directory - make_dir(subdir); - } - } + create_dirs(dest.path()); const bool is_zip = is_zip_file(src); const long filesize = fsize(src) * (is_zip ? 4 : 1); @@ -931,7 +939,12 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) dst.rtrim(1); dst << '_'; } + if (!dst.exist()) + create_dirs(dst.path()); + ok = ::fcopy(src, dst); + if (ok && is_zip_file(src)) + aga_unzip(src, dst.path()); if (ok && reboot != NONE) _reboot_program |= reboot;