From b0c86b6db0b3d1ead73077d2d80b0d99932ce3ae Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 24 Mar 1995 11:16:17 +0000 Subject: [PATCH] Aggiunta modalita per aprire i file temporanei in un direttorio fissato git-svn-id: svn://10.65.10.50/trunk@1161 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/isam.cpp | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/include/isam.cpp b/include/isam.cpp index 75c189299..73c33e83d 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -774,16 +774,39 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create) { TRecnotype eod = 0; TRecnotype eox = 100; + + TFilename n; - TFilename n; n.tempdir(); n << '/' << radix; n.ext("dta"); + if (radix && *radix) + { + if (*radix == '%') + n = radix; + else + { + n.tempdir(); + n << '/' << radix; + } + } + + n.ext("dta"); if (!create) { TDir dir; dir.get(logicnum); - const word& len = dir.len(); + const word& len = dir.len(); + + // Tolgo il % senno' che fa la fopen ? + if (n[0] == '%') + n = n.sub(1); FILE* f = fopen(n, "r"); + +#if XVT_OS != XVT_OS_SCOUNIX + CHECKS(f, "Can't open temporary file ", (const char*)strerror(NULL)); +#else CHECKS(f, "Can't open temporary file ", (const char*)n); +#endif + fseek(f, 0, SEEK_END); eod = eox = ftell(f) / len; fclose(f); @@ -791,8 +814,13 @@ TIsamtempfile::TIsamtempfile(int logicnum, const char* radix, bool create) _autodel = create > TRUE; - n.ext(""); - n.insert("%", 0); + n.ext(""); + + // Ci rimetto il % se prima l'avevo tolto, senno' che fa la open ? + // if (*radix == '%') + if (n[0] != '%') + n.insert("%", 0); + open(n, create, eod, eox); }