Update Boost filesystem API usage
This commit is contained in:
+1
-1
@@ -1036,7 +1036,7 @@ bool AppInit2()
|
||||
std::string strDataDir = GetDataDir().string();
|
||||
#ifdef ENABLE_WALLET
|
||||
// Wallet file must be a plain filename without a directory
|
||||
if (strWalletFile != boost::filesystem::basename(strWalletFile) + boost::filesystem::extension(strWalletFile))
|
||||
if (strWalletFile != boost::filesystem::path(strWalletFile).filename().string())
|
||||
return InitError(strprintf(_("Wallet %s resides outside data directory %s"), strWalletFile, strDataDir));
|
||||
#endif
|
||||
// Make sure only a single Agrarian process is using the data directory.
|
||||
|
||||
@@ -74,7 +74,7 @@ static const std::string COOKIEAUTH_FILE = ".cookie";
|
||||
boost::filesystem::path GetAuthCookieFile()
|
||||
{
|
||||
boost::filesystem::path path(GetArg("-rpccookiefile", COOKIEAUTH_FILE));
|
||||
if (!path.is_complete()) path = GetDataDir() / path;
|
||||
if (!path.is_absolute()) path = GetDataDir() / path;
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -478,7 +478,7 @@ void ClearDatadirCache()
|
||||
boost::filesystem::path GetConfigFile()
|
||||
{
|
||||
boost::filesystem::path pathConfigFile(GetArg("-conf", "agrarian.conf"));
|
||||
if (!pathConfigFile.is_complete())
|
||||
if (!pathConfigFile.is_absolute())
|
||||
pathConfigFile = GetDataDir(false) / pathConfigFile;
|
||||
|
||||
return pathConfigFile;
|
||||
@@ -487,7 +487,7 @@ boost::filesystem::path GetConfigFile()
|
||||
boost::filesystem::path GetMasternodeConfigFile()
|
||||
{
|
||||
boost::filesystem::path pathConfigFile(GetArg("-mnconf", "masternode.conf"));
|
||||
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir() / pathConfigFile;
|
||||
if (!pathConfigFile.is_absolute()) pathConfigFile = GetDataDir() / pathConfigFile;
|
||||
return pathConfigFile;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
|
||||
boost::filesystem::path GetPidFile()
|
||||
{
|
||||
boost::filesystem::path pathPidFile(GetArg("-pid", "agrariand.pid"));
|
||||
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
|
||||
if (!pathPidFile.is_absolute()) pathPidFile = GetDataDir() / pathPidFile;
|
||||
return pathPidFile;
|
||||
}
|
||||
|
||||
|
||||
@@ -1077,7 +1077,7 @@ bool AttemptBackupWallet(const CWallet& wallet, const filesystem::path& pathSrc,
|
||||
return false;
|
||||
}
|
||||
#if BOOST_VERSION >= 105800 /* BOOST_LIB_VERSION 1_58 */
|
||||
filesystem::copy_file(pathSrc.c_str(), pathDest, filesystem::copy_option::overwrite_if_exists);
|
||||
filesystem::copy_file(pathSrc.c_str(), pathDest, filesystem::copy_options::overwrite_existing);
|
||||
#else
|
||||
std::ifstream src(pathSrc.c_str(), std::ios::binary | std::ios::in);
|
||||
std::ofstream dst(pathDest.c_str(), std::ios::binary | std::ios::out | std::ios::trunc);
|
||||
|
||||
Reference in New Issue
Block a user