| 3067 | |
| 3068 | namespace platform { |
| 3069 | std::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 | |
| 3087 | std::string getDefaultClusterFilePath() { |
| 3088 | return joinPath(getDefaultConfigPath(), "fdb.cluster"); |
no test coverage detected