MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / GetTempPath

Function GetTempPath

src/test/testutil.cpp:13–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <boost/filesystem.hpp>
12
13boost::filesystem::path GetTempPath() {
14#if BOOST_FILESYSTEM_VERSION == 3
15 return boost::filesystem::temp_directory_path();
16#else
17 // TODO: remove when we don't support filesystem v2 anymore
18 boost::filesystem::path path;
19#ifdef WIN32
20 char pszPath[MAX_PATH] = "";
21
22 if (GetTempPathA(MAX_PATH, pszPath))
23 path = boost::filesystem::path(pszPath);
24#else
25 path = boost::filesystem::path("/tmp");
26#endif
27 if (path.empty() || !boost::filesystem::is_directory(path)) {
28 LogPrintf("GetTempPath(): failed to find temp path\n");
29 return boost::filesystem::path("");
30 }
31 return path;
32#endif
33}

Callers 1

TestingSetupMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected