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/asset_reader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/asset_reader.h') diff --git a/src/asset_reader.h b/src/asset_reader.h index 8478b51f..c8953e09 100644 --- a/src/asset_reader.h +++ b/src/asset_reader.h @@ -44,6 +44,7 @@ #include "asset.h" #include "crypto_context.h" #include "dcp_assert.h" +#include "filesystem.h" #include #include @@ -98,7 +99,7 @@ private: { _reader = new R (); DCP_ASSERT (asset->file()); - auto const r = _reader->OpenRead (asset->file()->string().c_str()); + auto const r = _reader->OpenRead(dcp::filesystem::fix_long_path(*asset->file()).string().c_str()); if (ASDCP_FAILURE(r)) { delete _reader; boost::throw_exception (FileError("could not open MXF file for reading", asset->file().get(), r)); -- cgit v1.2.3