Skip to content

Commit

Permalink
Replace boost::filesystem with std:filesystem (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
arahlin authored Nov 20, 2024
1 parent 88abb76 commit a15fcd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_PYTHON_VERSION ${Python_VERSION})
find_package(Boost COMPONENTS system iostreams filesystem python REQUIRED)
find_package(Boost COMPONENTS iostreams python REQUIRED)

# Interface library for flags and library dependencies
add_library(spt3g INTERFACE)
Expand Down
12 changes: 6 additions & 6 deletions core/src/dataio.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/device/array.hpp>
#include <boost/iostreams/device/back_inserter.hpp>
#include <boost/filesystem.hpp>
#include <filesystem>

#include <sys/types.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -223,24 +223,24 @@ g3_check_input_path(const std::string &path)
if (path.find("://") != path.npos)
return;

boost::filesystem::path fpath(path);
if (!boost::filesystem::exists(fpath) ||
!boost::filesystem::is_regular_file(fpath))
std::filesystem::path fpath(path);
if (!std::filesystem::exists(fpath) ||
!std::filesystem::is_regular_file(fpath))
log_fatal("Could not find file %s", path.c_str());
}

void
g3_check_output_path(const std::string &path)
{
boost::filesystem::path fpath(path);
std::filesystem::path fpath(path);

if (fpath.empty())
log_fatal("Empty file path");

if (!fpath.has_parent_path())
return;

if (!boost::filesystem::exists(fpath.parent_path()))
if (!std::filesystem::exists(fpath.parent_path()))
log_fatal("Parent path does not exist: %s",
fpath.parent_path().string().c_str());
}
2 changes: 1 addition & 1 deletion deps/install_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ ! -e b2 ]; then
--prefix=${PREFIX} \
--with-python=$(which python3) \
--with-python-root=$(python3-config --prefix) \
--with-libraries="system,iostreams,filesystem,python,regex"
--with-libraries="iostreams,python,regex"
fi

echo "Building boost..."
Expand Down

0 comments on commit a15fcd9

Please sign in to comment.