Skip to content

Commit 4b3b85c

Browse files
committed
refactor: use fs:: over boost::filesystem::
1 parent 80127f0 commit 4b3b85c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/logging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void BCLog::Logger::ShrinkDebugFile()
245245
size_t log_size = 0;
246246
try {
247247
log_size = fs::file_size(m_file_path);
248-
} catch (boost::filesystem::filesystem_error &) {}
248+
} catch (const fs::filesystem_error&) {}
249249

250250
// If debug.log file is more than 10% bigger the RECENT_DEBUG_HISTORY_SIZE
251251
// trim it down by saving only the last RECENT_DEBUG_HISTORY_SIZE bytes

src/qt/guiutil.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,10 @@ void openDebugLogfile()
368368

369369
bool openBitcoinConf()
370370
{
371-
boost::filesystem::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
371+
fs::path pathConfig = GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME));
372372

373373
/* Create the file */
374-
boost::filesystem::ofstream configFile(pathConfig, std::ios_base::app);
374+
fs::ofstream configFile(pathConfig, std::ios_base::app);
375375

376376
if (!configFile.good())
377377
return false;

src/wallet/rpcdump.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,15 +706,15 @@ UniValue dumpwallet(const JSONRPCRequest& request)
706706

707707
EnsureWalletIsUnlocked(pwallet);
708708

709-
boost::filesystem::path filepath = request.params[0].get_str();
710-
filepath = boost::filesystem::absolute(filepath);
709+
fs::path filepath = request.params[0].get_str();
710+
filepath = fs::absolute(filepath);
711711

712712
/* Prevent arbitrary files from being overwritten. There have been reports
713713
* that users have overwritten wallet files this way:
714714
* https://github.com/bitcoin/bitcoin/issues/9934
715715
* It may also avoid other security issues.
716716
*/
717-
if (boost::filesystem::exists(filepath)) {
717+
if (fs::exists(filepath)) {
718718
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");
719719
}
720720

0 commit comments

Comments
 (0)