diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-06 02:37:16 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-09 23:38:28 +0200 |
| commit | 96f50dd5e600925488fdd9db1580aa01b026269b (patch) | |
| tree | ea8b837a596eb99a7416bfdbfd2d7e4f38603a7b /src/lib/state.cc | |
| parent | 94a9473993b027b9368077009decbdd4322f90e3 (diff) | |
Use dcp::filesystem to wrap filesystem calls and fix_long_path
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; } |
