From 4b3b85c597a2d4139ecaa6b78b2fa9c89be3319f Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 15 Aug 2018 21:05:21 +0800 Subject: refactor: use fs:: over boost::filesystem:: --- src/logging.cpp | 2 +- src/qt/guiutil.cpp | 4 ++-- src/wallet/rpcdump.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/logging.cpp b/src/logging.cpp index e8e22cbf97..6557dddffb 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -245,7 +245,7 @@ void BCLog::Logger::ShrinkDebugFile() size_t log_size = 0; try { log_size = fs::file_size(m_file_path); - } catch (boost::filesystem::filesystem_error &) {} + } catch (const fs::filesystem_error&) {} // If debug.log file is more than 10% bigger the RECENT_DEBUG_HISTORY_SIZE // trim it down by saving only the last RECENT_DEBUG_HISTORY_SIZE bytes diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index f8f031041c..f8391b6303 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -368,10 +368,10 @@ void openDebugLogfile() bool openBitcoinConf() { - boost::filesystem::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)); + fs::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)); /* Create the file */ - boost::filesystem::ofstream configFile(pathConfig, std::ios_base::app); + fs::ofstream configFile(pathConfig, std::ios_base::app); if (!configFile.good()) return false; diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 5800e75827..7cb41da39e 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -706,15 +706,15 @@ UniValue dumpwallet(const JSONRPCRequest& request) EnsureWalletIsUnlocked(pwallet); - boost::filesystem::path filepath = request.params[0].get_str(); - filepath = boost::filesystem::absolute(filepath); + fs::path filepath = request.params[0].get_str(); + filepath = fs::absolute(filepath); /* Prevent arbitrary files from being overwritten. There have been reports * that users have overwritten wallet files this way: * https://github.com/bitcoin/bitcoin/issues/9934 * It may also avoid other security issues. */ - if (boost::filesystem::exists(filepath)) { + if (fs::exists(filepath)) { throw JSONRPCError(RPC_INVALID_PARAMETER, filepath.string() + " already exists. If you are sure this is what you want, move it out of the way first"); } -- cgit v1.2.3