Aggiunto zappamento 770
git-svn-id: svn://10.65.10.50/trunk@1313 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d82f696754
commit
736e44488e
46
ba/bacnv.cpp
46
ba/bacnv.cpp
@ -8,10 +8,17 @@
|
|||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
#include <extcdecl.h>
|
||||||
|
#if XVT_OS == XVT_OS_WIN
|
||||||
|
#include <direct.h>
|
||||||
|
#define RMDIR _rmdir
|
||||||
|
#else
|
||||||
|
#define RMDIR rmdir
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
|
|
||||||
#define usage "Errore - uso : bacnv [1|2|3] ditta"
|
#define usage "Errore - uso : bacnv [1|2|3|4] ditta"
|
||||||
|
|
||||||
class TConversione_archivi : public TApplication
|
class TConversione_archivi : public TApplication
|
||||||
{
|
{
|
||||||
@ -33,6 +40,7 @@ public:
|
|||||||
bool patch_uff(TRectype & rec, const char * const fnames[]);
|
bool patch_uff(TRectype & rec, const char * const fnames[]);
|
||||||
bool collate(TRectype & rec, const char * f1, const char * f2);
|
bool collate(TRectype & rec, const char * f1, const char * f2);
|
||||||
void patch_com(void);
|
void patch_com(void);
|
||||||
|
void zero_770(void);
|
||||||
|
|
||||||
TConversione_archivi() : _oldditta(0), _codditta(0), _error(0) {}
|
TConversione_archivi() : _oldditta(0), _codditta(0), _error(0) {}
|
||||||
};
|
};
|
||||||
@ -92,6 +100,9 @@ bool TConversione_archivi::menu(MENU_TAG)
|
|||||||
case 3:
|
case 3:
|
||||||
if (_codditta == 0)
|
if (_codditta == 0)
|
||||||
patch_com();
|
patch_com();
|
||||||
|
case 4:
|
||||||
|
if (_codditta == 0)
|
||||||
|
zero_770();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -247,6 +258,37 @@ void TConversione_archivi::patch_com()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TConversione_archivi::zero_770()
|
||||||
|
{
|
||||||
|
for (int i = LF_BASE ; i <= LF_DETH; i++)
|
||||||
|
{
|
||||||
|
TDir d;
|
||||||
|
|
||||||
|
d.get(i, _lock, _nordir, _sysdirop);
|
||||||
|
d.eod() = 0L;
|
||||||
|
d.eox() = 0L;
|
||||||
|
d.put(i, _nordir, _sysdirop);
|
||||||
|
}
|
||||||
|
TToken_string files;
|
||||||
|
|
||||||
|
if (fexist(format("%scom/770", __ptprf)))
|
||||||
|
{
|
||||||
|
files.format("%scom/770/%s", __ptprf, "*");
|
||||||
|
list_files(files);
|
||||||
|
for (const char * s = files.get(); s != NULL; s = files.get())
|
||||||
|
remove(s);
|
||||||
|
RMDIR(format("%scom/770", __ptprf));
|
||||||
|
}
|
||||||
|
if (fexist(format("%s770", __ptprf)))
|
||||||
|
{
|
||||||
|
files.format("%s770/%s", __ptprf, "*");
|
||||||
|
list_files(files);
|
||||||
|
for (const char * s = files.get(); s != NULL; s = files.get())
|
||||||
|
remove(s);
|
||||||
|
RMDIR(format("%s770", __ptprf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Programma di conversione archivi speciale
|
// Programma di conversione archivi speciale
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -255,7 +297,7 @@ int main(int argc,char** argv)
|
|||||||
{
|
{
|
||||||
const int r = (argc > 1) ? atoi(argv[1]) : 0;
|
const int r = (argc > 1) ? atoi(argv[1]) : 0;
|
||||||
|
|
||||||
if (r <= 0 || r > 3)
|
if (r <= 0 || r > 4)
|
||||||
{
|
{
|
||||||
error_box(usage);
|
error_box(usage);
|
||||||
return 100;
|
return 100;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user