1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00
This commit is contained in:
David Hill
2018-09-19 14:38:25 -05:00
parent 6911730113
commit c7d3dc173e
3 changed files with 49 additions and 0 deletions

View File

@ -71,6 +71,49 @@ const string StartUp::installDir()
return *fInstallDirp;
}
/* static */
mutex StartUp::fTmpDirLock;
/* static */
string* StartUp::fTmpDirp = 0;
/* static */
const string StartUp::tmpDir()
{
mutex::scoped_lock lk(fTmpDirLock);
if (fTmpDirp)
return *fTmpDirp;
#ifdef _MSC_VER
fTmpDirp = new string("C:\\Calpont\Tmp");
string cfStr = IDBreadRegistry("");
if (!cfStr.empty())
*fTmpDirp = cfStr;
#else
fTmpDirp = new string("/tmp");
//See if we can figure out the tmp dir in Linux...
//1. env var COLUMNSTORE_INSTALL_DIR
const char* p = 0;
p = getenv("COLUMNSTORE_INSTALL_DIR");
if (p && *p)
{
string homedir = "/";
char* p = getenv("HOME");
if (p && *p)
homedir = p;
*fTmpDirp = homedir + "/tmp";
}
#endif
return *fTmpDirp;
}
}
// vim:ts=4 sw=4: