Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use fs:: over boost::filesystem:: #13982

Merged
merged 1 commit into from Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/logging.cpp
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/qt/guiutil.cpp
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/rpcdump.cpp
Expand Up @@ -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");
}

Expand Down