diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-06 02:37:16 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-09 01:21:22 +0200 |
| commit | f0f4dd5e6b6ed5e50d0444a4de3b2a13156edf64 (patch) | |
| tree | dce96c211c6d92062187e8c40026c04a26af72e9 /src/lib/state.cc | |
| parent | 89e39ea9e20bc4f8e88e42a57d4505e1fa69fde5 (diff) | |
Use dcp::filesystem to wrap filesystem calls and fix_long_path2623-add-windows
anything that is passed to read_file() from libcxml.
This should fix #2623 and other similar problems.
Diffstat (limited to 'src/lib/state.cc')
| -rw-r--r-- | src/lib/state.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/state.cc b/src/lib/state.cc index e22f9e0b9..f345d119e 100644 --- a/src/lib/state.cc +++ b/src/lib/state.cc @@ -22,6 +22,7 @@ #include "cross.h" #include "state.h" #include "util.h" +#include <dcp/filesystem.h> #include <glib.h> @@ -60,11 +61,9 @@ config_path_or_override (optional<string> version) boost::filesystem::path State::read_path (string file) { - using namespace boost::filesystem; - for (auto i: config_versions) { auto full = config_path_or_override(i) / file; - if (exists(full)) { + if (dcp::filesystem::exists(full)) { return full; } } @@ -79,9 +78,9 @@ State::read_path (string file) boost::filesystem::path State::write_path (string file) { - boost::filesystem::path p = config_path_or_override(config_versions.front()); + auto p = config_path_or_override(config_versions.front()); boost::system::error_code ec; - boost::filesystem::create_directories (p, ec); + dcp::filesystem::create_directories(p, ec); p /= file; return p; } |
