MCPcopy Create free account
hub / github.com/apple/foundationdb / getDefaultConfigPath

Function getDefaultConfigPath

flow/Platform.actor.cpp:3069–3085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3067
3068namespace platform {
3069std::string getDefaultConfigPath() {
3070#ifdef _WIN32
3071 TCHAR szPath[MAX_PATH];
3072 if (SHGetFolderPath(nullptr, CSIDL_COMMON_APPDATA, nullptr, 0, szPath) != S_OK) {
3073 TraceEvent(SevError, "WindowsAppDataError").GetLastError();
3074 throw platform_error();
3075 }
3076 std::string _filepath(szPath);
3077 return _filepath + "\\foundationdb";
3078#elif defined(__linux__)
3079 return "/etc/foundationdb";
3080#elif defined(__APPLE__) || defined(__FreeBSD__)
3081 return "/usr/local/etc/foundationdb";
3082#else
3083#error Port me!
3084#endif
3085}
3086
3087std::string getDefaultClusterFilePath() {
3088 return joinPath(getDefaultConfigPath(), "fdb.cluster");

Callers 3

getKeyPathSyncMethod · 0.85

Calls 1

TraceEventClass · 0.85

Tested by

no test coverage detected