@@ -212,7 +212,7 @@ void Shutdown()
212212
213213 if (fFeeEstimatesInitialized )
214214 {
215- boost::filesystem ::path est_path = GetDataDir () / FEE_ESTIMATES_FILENAME;
215+ fs ::path est_path = GetDataDir () / FEE_ESTIMATES_FILENAME;
216216 CAutoFile est_fileout (fopen (est_path.string ().c_str (), " wb" ), SER_DISK, CLIENT_VERSION);
217217 if (!est_fileout.IsNull ())
218218 mempool.WriteFeeEstimates (est_fileout);
@@ -250,8 +250,8 @@ void Shutdown()
250250
251251#ifndef WIN32
252252 try {
253- boost::filesystem ::remove (GetPidFile ());
254- } catch (const boost::filesystem ::filesystem_error& e) {
253+ fs ::remove (GetPidFile ());
254+ } catch (const fs ::filesystem_error& e) {
255255 LogPrintf (" %s: Unable to remove pidfile: %s\n " , __func__, e.what ());
256256 }
257257#endif
@@ -578,14 +578,14 @@ struct CImportingNow
578578// works correctly.
579579void CleanupBlockRevFiles ()
580580{
581- std::map<std::string, boost::filesystem ::path> mapBlockFiles;
581+ std::map<std::string, fs ::path> mapBlockFiles;
582582
583583 // Glob all blk?????.dat and rev?????.dat files from the blocks directory.
584584 // Remove the rev files immediately and insert the blk file paths into an
585585 // ordered map keyed by block file index.
586586 LogPrintf (" Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune\n " );
587- boost::filesystem ::path blocksdir = GetDataDir () / " blocks" ;
588- for (boost::filesystem:: directory_iterator it (blocksdir); it != boost::filesystem ::directory_iterator (); it++) {
587+ fs ::path blocksdir = GetDataDir () / " blocks" ;
588+ for (fs:: directory_iterator it (blocksdir); it != fs ::directory_iterator (); it++) {
589589 if (is_regular_file (*it) &&
590590 it->path ().filename ().string ().length () == 12 &&
591591 it->path ().filename ().string ().substr (8 ,4 ) == " .dat" )
@@ -602,7 +602,7 @@ void CleanupBlockRevFiles()
602602 // keeping a separate counter. Once we hit a gap (or if 0 doesn't exist)
603603 // start removing block files.
604604 int nContigCounter = 0 ;
605- BOOST_FOREACH (const PAIRTYPE (std::string, boost::filesystem ::path)& item, mapBlockFiles) {
605+ BOOST_FOREACH (const PAIRTYPE (std::string, fs ::path)& item, mapBlockFiles) {
606606 if (atoi (item.first ) == nContigCounter) {
607607 nContigCounter++;
608608 continue ;
@@ -611,7 +611,7 @@ void CleanupBlockRevFiles()
611611 }
612612}
613613
614- void ThreadImport (std::vector<boost::filesystem ::path> vImportFiles)
614+ void ThreadImport (std::vector<fs ::path> vImportFiles)
615615{
616616 const CChainParams& chainparams = Params ();
617617 RenameThread (" bitcoin-loadblk" );
@@ -624,7 +624,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
624624 int nFile = 0 ;
625625 while (true ) {
626626 CDiskBlockPos pos (nFile, 0 );
627- if (!boost::filesystem ::exists (GetBlockPosFilename (pos, " blk" )))
627+ if (!fs ::exists (GetBlockPosFilename (pos, " blk" )))
628628 break ; // No block files left to reindex
629629 FILE *file = OpenBlockFile (pos, true );
630630 if (!file)
@@ -641,11 +641,11 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
641641 }
642642
643643 // hardcoded $DATADIR/bootstrap.dat
644- boost::filesystem ::path pathBootstrap = GetDataDir () / " bootstrap.dat" ;
645- if (boost::filesystem ::exists (pathBootstrap)) {
644+ fs ::path pathBootstrap = GetDataDir () / " bootstrap.dat" ;
645+ if (fs ::exists (pathBootstrap)) {
646646 FILE *file = fopen (pathBootstrap.string ().c_str (), " rb" );
647647 if (file) {
648- boost::filesystem ::path pathBootstrapOld = GetDataDir () / " bootstrap.dat.old" ;
648+ fs ::path pathBootstrapOld = GetDataDir () / " bootstrap.dat.old" ;
649649 LogPrintf (" Importing bootstrap.dat...\n " );
650650 LoadExternalBlockFile (chainparams, file);
651651 RenameOver (pathBootstrap, pathBootstrapOld);
@@ -655,7 +655,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
655655 }
656656
657657 // -loadblock=
658- BOOST_FOREACH (const boost::filesystem ::path& path, vImportFiles) {
658+ BOOST_FOREACH (const fs ::path& path, vImportFiles) {
659659 FILE *file = fopen (path.string ().c_str (), " rb" );
660660 if (file) {
661661 LogPrintf (" Importing blocks file %s...\n " , path.string ());
@@ -1123,7 +1123,7 @@ static bool LockDataDirectory(bool probeOnly)
11231123 std::string strDataDir = GetDataDir ().string ();
11241124
11251125 // Make sure only a single Bitcoin process is using the data directory.
1126- boost::filesystem ::path pathLockFile = GetDataDir () / " .lock" ;
1126+ fs ::path pathLockFile = GetDataDir () / " .lock" ;
11271127 FILE* file = fopen (pathLockFile.string ().c_str (), " a" ); // empty lock file; created if it doesn't exist.
11281128 if (file) fclose (file);
11291129
@@ -1388,7 +1388,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
13881388 fReindex = GetBoolArg (" -reindex" , false );
13891389 bool fReindexChainState = GetBoolArg (" -reindex-chainstate" , false );
13901390
1391- boost::filesystem ::create_directories (GetDataDir () / " blocks" );
1391+ fs ::create_directories (GetDataDir () / " blocks" );
13921392
13931393 // cache size calculations
13941394 int64_t nTotalCache = (GetArg (" -dbcache" , nDefaultDbCache) << 20 );
@@ -1534,7 +1534,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
15341534 }
15351535 LogPrintf (" block index %15dms\n " , GetTimeMillis () - nStart);
15361536
1537- boost::filesystem ::path est_path = GetDataDir () / FEE_ESTIMATES_FILENAME;
1537+ fs ::path est_path = GetDataDir () / FEE_ESTIMATES_FILENAME;
15381538 CAutoFile est_filein (fopen (est_path.string ().c_str (), " rb" ), SER_DISK, CLIENT_VERSION);
15391539 // Allowed to fail as this file IS missing on first startup.
15401540 if (!est_filein.IsNull ())
@@ -1590,7 +1590,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
15901590 if (IsArgSet (" -blocknotify" ))
15911591 uiInterface.NotifyBlockTip .connect (BlockNotifyCallback);
15921592
1593- std::vector<boost::filesystem ::path> vImportFiles;
1593+ std::vector<fs ::path> vImportFiles;
15941594 if (mapMultiArgs.count (" -loadblock" ))
15951595 {
15961596 BOOST_FOREACH (const std::string& strFile, mapMultiArgs.at (" -loadblock" ))
0 commit comments