2 * Written by Arno Bakker
3 * see LICENSE.txt for license information
17 std::string gettmpdir(void)
20 DWORD result = ::GetTempPath(0, _T(""));
22 throw std::runtime_error("Could not get system temp path");
24 std::vector<TCHAR> tempPath(result + 1);
25 result = ::GetTempPath(static_cast<DWORD>(tempPath.size()), &tempPath[0]);
26 if((result == 0) || (result >= tempPath.size()))
27 throw std::runtime_error("Could not get system temp path");
29 return std::string(tempPath.begin(), tempPath.begin() + static_cast<std::size_t>(result));
31 return std::string("/tmp/");