MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetDefaultDataDir

Function GetDefaultDataDir

src/util.cpp:705–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

703}
704
705fs::path GetDefaultDataDir()
706{
707 // Windows < Vista: C:\Documents and Settings\Username\Application Data\BitcoinGold
708 // Windows >= Vista: C:\Users\Username\AppData\Roaming\BitcoinGold
709 // Mac: ~/Library/Application Support/BitcoinGold
710 // Unix: ~/.bitcoingold
711#ifdef WIN32
712 // Windows
713 return GetSpecialFolderPath(CSIDL_APPDATA) / "BitcoinGold";
714#else
715 fs::path pathRet;
716 char* pszHome = getenv("HOME");
717 if (pszHome == nullptr || strlen(pszHome) == 0)
718 pathRet = fs::path("/");
719 else
720 pathRet = fs::path(pszHome);
721#ifdef MAC_OSX
722 // Mac
723 return pathRet / "Library/Application Support/BitcoinGold";
724#else
725 // Unix
726 return pathRet / ".bitcoingold";
727#endif
728#endif
729}
730
731static fs::path g_blocks_path_cached;
732static fs::path g_blocks_path_cache_net_specific;

Callers 3

AppInitMainFunction · 0.85
util.cppFile · 0.85

Calls 1

GetSpecialFolderPathFunction · 0.85

Tested by

no test coverage detected