Patch level : 10.0
Files correlati : ba8 lv3 Ricompilazione Demo : [ ] Commento : Migliorato supporto per percorsi dati lunghi (> 30) git-svn-id: svn://10.65.10.50/trunk@17811 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b5f5be5f06
commit
583a229d2b
@ -119,7 +119,8 @@ TInfo_mask::TInfo_mask()
|
|||||||
add_row(TR("Sistema Operativo"), stros);
|
add_row(TR("Sistema Operativo"), stros);
|
||||||
add_row(TR("Utente"), user());
|
add_row(TR("Utente"), user());
|
||||||
add_row(TR("Computer"), strcpu);
|
add_row(TR("Computer"), strcpu);
|
||||||
add_row(TR("Studio"), firm2dir(-1));
|
const TString study = firm2dir(-1);
|
||||||
|
add_row(TR("Studio"), study, study.find(' ') > 0 || study.len() > 30);
|
||||||
add_row(TR("Ditta"), campoini.get("Firm", "Main"));
|
add_row(TR("Ditta"), campoini.get("Firm", "Main"));
|
||||||
if (prefix_valid())
|
if (prefix_valid())
|
||||||
{
|
{
|
||||||
@ -133,7 +134,7 @@ TInfo_mask::TInfo_mask()
|
|||||||
add_row(TR("Config utente"), userini.name(), userini.name().find(' ') >= 0);
|
add_row(TR("Config utente"), userini.name(), userini.name().find(' ') >= 0);
|
||||||
add_row(TR("File temporanei"), temp, temp.find(' ') >= 0);
|
add_row(TR("File temporanei"), temp, temp.find(' ') >= 0);
|
||||||
|
|
||||||
const long mbfree = xvt_fsys_get_disk_free_space(firm2dir(-1), 'M');
|
const long mbfree = xvt_fsys_get_disk_free_space(study, 'M');
|
||||||
TString16 strmb; strmb.format("%ld Mb", mbfree);
|
TString16 strmb; strmb.format("%ld Mb", mbfree);
|
||||||
add_row(TR("Spazio su disco"), strmb, mbfree < 512);
|
add_row(TR("Spazio su disco"), strmb, mbfree < 512);
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ void COpenDir(lockmode, dirflg)
|
|||||||
PathSt name;
|
PathSt name;
|
||||||
|
|
||||||
if (dirfl[dirflg]++) return;
|
if (dirfl[dirflg]++) return;
|
||||||
strcpy(name, CInsPref(directory, dirflg)) ;
|
strncpy(name, CInsPref(directory, dirflg), sizeof(name)) ;
|
||||||
COpen(&fdir[dirflg], name, sizeof(FileDes), 0, lockmode) ;
|
COpen(&fdir[dirflg], name, sizeof(FileDes), 0, lockmode) ;
|
||||||
if (fdir[dirflg].IOR != NoErr)
|
if (fdir[dirflg].IOR != NoErr)
|
||||||
{
|
{
|
||||||
@ -285,7 +285,7 @@ void COpenRecDir(lockmode,dirflg)
|
|||||||
PathSt name;
|
PathSt name;
|
||||||
|
|
||||||
if (recfl[dirflg]++) return;
|
if (recfl[dirflg]++) return;
|
||||||
strcpy(name, CInsPref(ntrrec, dirflg)) ;
|
strncpy(name, CInsPref(ntrrec, dirflg), sizeof(name)) ;
|
||||||
COpen(&rdir[dirflg], name, sizeof(RecDes), 0, lockmode) ;
|
COpen(&rdir[dirflg], name, sizeof(RecDes), 0, lockmode) ;
|
||||||
if (rdir[dirflg].IOR != NoErr)
|
if (rdir[dirflg].IOR != NoErr)
|
||||||
{
|
{
|
||||||
@ -488,35 +488,22 @@ void CPutPref(const char* pref) /* stringa contenente il nuovo prefisso */
|
|||||||
@(FN)
|
@(FN)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *CAddPref(name)
|
static char __s[_MAX_PATH];
|
||||||
char *name; /* nome file */
|
|
||||||
|
|
||||||
|
char* CAddPref(const char* name) /* nome file */
|
||||||
{
|
{
|
||||||
static char* s = NULL;
|
|
||||||
|
|
||||||
if (*name == '$')
|
if (*name == '$')
|
||||||
{
|
return(CInsPref(name+1, NORDIR)) ;
|
||||||
name++;
|
|
||||||
return(CInsPref(name, NORDIR)) ;
|
if (*name == '%')
|
||||||
}
|
return CInsPref(name+1, COMDIR);
|
||||||
else
|
|
||||||
{
|
if (strncmp(__ptprf, name, strlen(__ptprf)) != 0)
|
||||||
if (*name == '%')
|
sprintf(__s, "%s%s", __ptprf, name);
|
||||||
{
|
else
|
||||||
name++;
|
strcpy(__s, name);
|
||||||
return(CInsPref(name, COMDIR)) ;
|
|
||||||
}
|
return __s;
|
||||||
else
|
|
||||||
{
|
|
||||||
if (s == NULL)
|
|
||||||
s = malloc(_MAX_PATH);
|
|
||||||
if (strncmp(__ptprf, name, strlen(__ptprf)) != 0)
|
|
||||||
sprintf(s, "%s%s", __ptprf, name);
|
|
||||||
else
|
|
||||||
strcpy(s, name);
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -537,24 +524,17 @@ char *CAddPref(name)
|
|||||||
@(FN)
|
@(FN)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *CInsPref(name,dirflg)
|
char* CInsPref(const char* name, int dirflg)
|
||||||
char *name; /* nome del file cui aggiungere il prefisso */
|
|
||||||
int dirflg; /* flag per file comuni */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
static char* s = NULL;
|
|
||||||
if (s == NULL)
|
|
||||||
s = malloc(_MAX_PATH);
|
|
||||||
|
|
||||||
if (dirflg == NORDIR)
|
if (dirflg == NORDIR)
|
||||||
{
|
{
|
||||||
if (*cprefix == '\0')
|
if (*cprefix == '\0')
|
||||||
strcpy(s, name);
|
strcpy(__s, name);
|
||||||
else
|
else
|
||||||
xvt_fsys_build_pathname(s, NULL, cprefix, name, NULL, NULL);
|
xvt_fsys_build_pathname(__s, NULL, cprefix, name, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf(s,"%scom%c%s", __ptprf, DIRSEP, name);
|
sprintf(__s,"%scom%c%s", __ptprf, DIRSEP, name);
|
||||||
return s;
|
return __s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,9 +102,9 @@ extern "C" {
|
|||||||
// word setrdes(RecDes *);
|
// word setrdes(RecDes *);
|
||||||
const char* CGetPref(void);
|
const char* CGetPref(void);
|
||||||
void CPutPref(const char *);
|
void CPutPref(const char *);
|
||||||
char *CAddPref(char *);
|
char* CAddPref(const char *);
|
||||||
/* @(!) 2.3.01.144 */
|
/* @(!) 2.3.01.144 */
|
||||||
char *CInsPref(char *, int);
|
char* CInsPref(const char *, int);
|
||||||
|
|
||||||
int CGetCampoStpValue(const char* name, char* value, int valsize);
|
int CGetCampoStpValue(const char* name, char* value, int valsize);
|
||||||
const char* CGetCampoIni(void);
|
const char* CGetCampoIni(void);
|
||||||
|
@ -389,13 +389,11 @@ void get_idx_names(
|
|||||||
|
|
||||||
// @comm Ritorna il nome con il prefisso corrente
|
// @comm Ritorna il nome con il prefisso corrente
|
||||||
{
|
{
|
||||||
long c = DB_getconf();
|
const long c = DB_getconf();
|
||||||
TDir d;
|
CHECKD(c & 1, "Bad index file format ", c);
|
||||||
TTrec r;
|
|
||||||
d.get(logicnum);
|
TFilename f = prefix().get_filename(logicnum);
|
||||||
r.get(logicnum);
|
/*
|
||||||
TFilename f(d.name());
|
|
||||||
|
|
||||||
if (c & 1) f.ext("cdx");
|
if (c & 1) f.ext("cdx");
|
||||||
if (c & 4) f.ext("mdx");
|
if (c & 4) f.ext("mdx");
|
||||||
i_names.cut(0);
|
i_names.cut(0);
|
||||||
@ -403,6 +401,9 @@ void get_idx_names(
|
|||||||
f.ext("");
|
f.ext("");
|
||||||
f.rtrim(1);
|
f.rtrim(1);
|
||||||
if ((c & 2) || (c & 8)) // DBIII or CLIPPER format, returns f_name + .cgp, f_nameX + .n{d|t}x
|
if ((c & 2) || (c & 8)) // DBIII or CLIPPER format, returns f_name + .cgp, f_nameX + .n{d|t}x
|
||||||
|
{
|
||||||
|
TTrec r;
|
||||||
|
r.get(logicnum);
|
||||||
for (int j=1; j<=r.keys();j++)
|
for (int j=1; j<=r.keys();j++)
|
||||||
{
|
{
|
||||||
TString xx=f.name();
|
TString xx=f.name();
|
||||||
@ -416,7 +417,11 @@ void get_idx_names(
|
|||||||
f.ext("ntx");
|
f.ext("ntx");
|
||||||
i_names.add(f);
|
i_names.add(f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
i_names.restart();
|
i_names.restart();
|
||||||
|
*/
|
||||||
|
f.ext("cdx");
|
||||||
|
i_names = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converte un errore di codebase in un errore isam
|
// Converte un errore di codebase in un errore isam
|
||||||
@ -1560,40 +1565,6 @@ TIsamfile::~TIsamfile()
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
//A cosa cavolo serve?
|
|
||||||
// @doc EXTERNAL
|
|
||||||
|
|
||||||
// @mfunc Aggiorna i flags associati al file
|
|
||||||
//
|
|
||||||
// @rdesc Ritorna NOERR se e' riuscita ad eseguire l'operazione, altrimenti ritorna il numero
|
|
||||||
// di errore generato (vedi <t TIsamerr>).
|
|
||||||
int TIsamfile::flags(
|
|
||||||
bool updateeod) // @parm Indica se aggiornare anche l'EOD del file
|
|
||||||
|
|
||||||
{
|
|
||||||
if (num() <= 0)
|
|
||||||
return NOERR ;
|
|
||||||
|
|
||||||
TDir d;
|
|
||||||
const TDirtype dirtype = prefix().get_dirtype(_filename);
|
|
||||||
d.get(num(), _lock, dirtype);
|
|
||||||
int err = d.status(dirtype);
|
|
||||||
if (err == NOERR)
|
|
||||||
{
|
|
||||||
const FileDes& fd = prefix().get_filedes(_filename);
|
|
||||||
d.flags() = fd.Flags;
|
|
||||||
if (updateeod)
|
|
||||||
d.eod() = fd.EOD;
|
|
||||||
d.put(num(), dirtype);
|
|
||||||
}
|
|
||||||
setstatus(err);
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TIsamtempfile
|
// TIsamtempfile
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -1622,20 +1593,13 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create, bool
|
|||||||
|
|
||||||
if (!create)
|
if (!create)
|
||||||
{
|
{
|
||||||
TDir dir; dir.get(logicnum);
|
TDir dir; dir.get(logicnum,_nolock,_nordir,_sysdirop);
|
||||||
const word& len = dir.len();
|
const long len = dir.len();
|
||||||
|
const long sz = fsize(n);
|
||||||
|
if (sz == 0)
|
||||||
|
fatal_box("Impossibile aprire il file %s: %s",(const char*) n,(const char*)_strerror(NULL));
|
||||||
|
|
||||||
FILE* f = fopen(n, "rb");
|
eod = eox = sz / len;
|
||||||
if (f == NULL)
|
|
||||||
#ifdef WIN32
|
|
||||||
fatal_box("Impossibile aprire il file temporaneo %s: %s",(const char*) n,(const char*)_strerror(NULL));
|
|
||||||
#else
|
|
||||||
fatal_box("Impossibile aprire il file temporaneo %s: %s",(const char*) n,(const char*)strerror(errno));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fseek(f, 0, SEEK_END);
|
|
||||||
eod = eox = ftell(f) / len;
|
|
||||||
fclose(f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(create == FALSE || create == TRUE, "Il flag di autodel ora si setta con il terzo parametro del costruttore");
|
CHECK(create == FALSE || create == TRUE, "Il flag di autodel ora si setta con il terzo parametro del costruttore");
|
||||||
|
@ -3262,8 +3262,8 @@ bool TEdit_field::parse_item(TScanner& scanner)
|
|||||||
const int logicnum = table2logic(tablename);
|
const int logicnum = table2logic(tablename);
|
||||||
if (logicnum > 0)
|
if (logicnum > 0)
|
||||||
{
|
{
|
||||||
TDir d; d.get(logicnum);
|
TFilename f = prefix().get_filename(logicnum); f.ext("dbf");
|
||||||
if (fexist(d.filename())) // Controlla l'esistenza del file
|
if (f.exist()) // Controlla l'esistenza del file
|
||||||
{
|
{
|
||||||
switch (logicnum)
|
switch (logicnum)
|
||||||
{
|
{
|
||||||
|
@ -490,11 +490,6 @@ const TFilename& TFile_info::load_filedes()
|
|||||||
_dir = _comdir;
|
_dir = _comdir;
|
||||||
else
|
else
|
||||||
_dir = _nordir;
|
_dir = _nordir;
|
||||||
/* COpenFile(num(), &_filedes, _nolock, _dir);
|
|
||||||
strncpy(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des));
|
|
||||||
_name = _filedes.SysName;
|
|
||||||
strncpy(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des));
|
|
||||||
*/
|
|
||||||
_name = CAddPref(_filedes.SysName);
|
_name = CAddPref(_filedes.SysName);
|
||||||
strncpy(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des)-1);
|
strncpy(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des)-1);
|
||||||
}
|
}
|
||||||
@ -1331,7 +1326,7 @@ bool TPrefix::build_firm_data(long codditta, bool flagcom)
|
|||||||
dir1.put(LF_DIR, _nordir, _sysdirop);
|
dir1.put(LF_DIR, _nordir, _sysdirop);
|
||||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
||||||
}
|
}
|
||||||
const long maxeod1 = dir.eod();
|
const long maxeod1 = dir.eod();
|
||||||
|
|
||||||
if (maxeod0 > maxeod1)
|
if (maxeod0 > maxeod1)
|
||||||
{
|
{
|
||||||
@ -1410,8 +1405,7 @@ public:
|
|||||||
|
|
||||||
void TTable_names::add_file(int logic, const TString& table)
|
void TTable_names::add_file(int logic, const TString& table)
|
||||||
{
|
{
|
||||||
TString8* id = new TString8;
|
TString8 id; id << logic;
|
||||||
id->format("%d", logic);
|
|
||||||
_names.add(table, id);
|
_names.add(table, id);
|
||||||
_ids.add(table, logic);
|
_ids.add(table, logic);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user