From e4b2ebd80779a44d24fe87af26ef278c1e2d97d2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 6 Oct 2023 02:04:49 +0200 Subject: Add wrappers around boost::filesystem methods that handle the required mangling of long filenames on Windows. Also wrap lots of missing places (e.g. calls to asdcplib, libxml++, libcxml etc.) in dcp::filesystem::fix_long_path(). The idea is to keep paths un-mangled until they we call some filesystem-related API and mangle them at that point. Otherwise we end up serialising mangled names, which seems like it will not end well. Should fix DoM #2623. --- src/pkl.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pkl.cc') diff --git a/src/pkl.cc b/src/pkl.cc index 390d5df2..57eda9da 100644 --- a/src/pkl.cc +++ b/src/pkl.cc @@ -39,6 +39,7 @@ #include "dcp_assert.h" #include "exceptions.h" +#include "filesystem.h" #include "pkl.h" #include "raw_convert.h" #include "util.h" @@ -64,7 +65,7 @@ PKL::PKL (boost::filesystem::path file) : _file (file) { cxml::Document pkl ("PackingList"); - pkl.read_file (file); + pkl.read_file(dcp::filesystem::fix_long_path(file)); if (pkl.namespace_uri() == pkl_interop_ns) { _standard = Standard::INTEROP; @@ -133,7 +134,7 @@ PKL::write_xml (boost::filesystem::path file, shared_ptr signer->sign (pkl, _standard); } - doc.write_to_file_formatted (file.string(), "UTF-8"); + doc.write_to_file_formatted(dcp::filesystem::fix_long_path(file).string(), "UTF-8"); _file = file; } -- cgit v1.2.3