From: Carl Hetherington Date: Thu, 22 Apr 2021 20:25:54 +0000 (+0200) Subject: Use new Windows long filename workaround with disk writer (#1755). X-Git-Tag: v2.15.141~19 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=8b8322ea5f3f62e5d1a20788c631d7c18e19055b Use new Windows long filename workaround with disk writer (#1755). --- diff --git a/src/lib/ext.cc b/src/lib/ext.cc index 39c90ae12..b7481e293 100644 --- a/src/lib/ext.cc +++ b/src/lib/ext.cc @@ -78,12 +78,14 @@ static void count (boost::filesystem::path dir, uint64_t& total_bytes) { + dir = fix_long_path (dir); + using namespace boost::filesystem; - for (directory_iterator i = directory_iterator(dir); i != directory_iterator(); ++i) { - if (is_directory(*i)) { - count (*i, total_bytes); + for (auto i: directory_iterator(dir)) { + if (is_directory(i)) { + count (i, total_bytes); } else { - total_bytes += file_size (*i); + total_bytes += file_size (i); } } } @@ -218,6 +220,8 @@ void copy (boost::filesystem::path from, boost::filesystem::path to, uint64_t& total_remaining, uint64_t total, vector& copied_files, Nanomsg* nanomsg) { LOG_DISK ("Copy %1 -> %2", from.string(), to.generic_string()); + from = fix_long_path (from); + to = fix_long_path (to); using namespace boost::filesystem;