From 8b8322ea5f3f62e5d1a20788c631d7c18e19055b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 22 Apr 2021 22:25:54 +0200 Subject: [PATCH] Use new Windows long filename workaround with disk writer (#1755). --- src/lib/ext.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; -- 2.30.2