| 823 | #endif |
| 824 | |
| 825 | boost::filesystem::path GetTempPath() |
| 826 | { |
| 827 | #if BOOST_FILESYSTEM_VERSION == 3 |
| 828 | return boost::filesystem::temp_directory_path(); |
| 829 | #else |
| 830 | // TODO: remove when we don't support filesystem v2 anymore |
| 831 | boost::filesystem::path path; |
| 832 | #ifdef WIN32 |
| 833 | char pszPath[MAX_PATH] = ""; |
| 834 | |
| 835 | if (GetTempPathA(MAX_PATH, pszPath)) |
| 836 | path = boost::filesystem::path(pszPath); |
| 837 | #else |
| 838 | path = boost::filesystem::path("/tmp"); |
| 839 | #endif |
| 840 | if (path.empty() || !boost::filesystem::is_directory(path)) { |
| 841 | LogPrintf("GetTempPath(): failed to find temp path\n"); |
| 842 | return boost::filesystem::path(""); |
| 843 | } |
| 844 | return path; |
| 845 | #endif |
| 846 | } |
| 847 | |
| 848 | void runCommand(std::string strCommand) |
| 849 | { |