Modificato il direttorio dei files temporanei
git-svn-id: svn://10.65.10.50/trunk@557 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
aa91be2d8e
commit
fb598c49fc
@ -3,6 +3,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <strstream.h>
|
#include <strstream.h>
|
||||||
|
#include <applicat.h>
|
||||||
|
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#if XVT_OS==XVT_OS_SCOUNIX
|
#if XVT_OS==XVT_OS_SCOUNIX
|
||||||
@ -589,8 +590,8 @@ const TFilename& TFilename::tempdir()
|
|||||||
if (dirpref == NULL) dirpref = "/tmp";
|
if (dirpref == NULL) dirpref = "/tmp";
|
||||||
set(dirpref);
|
set(dirpref);
|
||||||
const int last = len()-1;
|
const int last = len()-1;
|
||||||
if (!is_not_slash(_str[last])) cut(last);
|
|
||||||
|
|
||||||
|
if (!is_not_slash(_str[last])) cut(last);
|
||||||
if (!fexist(_str))
|
if (!fexist(_str))
|
||||||
{
|
{
|
||||||
int res =
|
int res =
|
||||||
@ -599,9 +600,26 @@ const TFilename& TFilename::tempdir()
|
|||||||
#else
|
#else
|
||||||
mkdir(_str);
|
mkdir(_str);
|
||||||
#endif
|
#endif
|
||||||
if (res == 0)
|
if (res != 0)
|
||||||
message_box("E' stata creata la directory per i file temporanei '%s'", _str);
|
fatal_box("Impossibile creare la directory '%s' per i file temporanei", _str);
|
||||||
else
|
}
|
||||||
|
if (not_empty()) *this << "/" ;
|
||||||
|
TString16 u(main_app().user());
|
||||||
|
|
||||||
|
u.lower();
|
||||||
|
*this << u;
|
||||||
|
if (!fexist(_str))
|
||||||
|
{
|
||||||
|
int res =
|
||||||
|
#if XVT_OS==XVT_OS_SCOUNIX
|
||||||
|
mkdir(_str, 0777);
|
||||||
|
#else
|
||||||
|
mkdir(_str);
|
||||||
|
#endif
|
||||||
|
// if (res == 0)
|
||||||
|
// message_box("E' stata creata la directory per i file temporanei '%s'", _str);
|
||||||
|
// else
|
||||||
|
if (res != 0)
|
||||||
fatal_box("Impossibile creare la directory '%s' per i file temporanei", _str);
|
fatal_box("Impossibile creare la directory '%s' per i file temporanei", _str);
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user