summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-22 22:25:54 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-23 17:44:14 +0200
commit8b8322ea5f3f62e5d1a20788c631d7c18e19055b (patch)
treed0af964f1519040b8d38b8ee08db248d57c47a57 /src/lib
parent6fb258f79548b588031c4cc6d0ca1774ca35b752 (diff)
Use new Windows long filename workaround with disk writer (#1755).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ext.cc12
1 files 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<CopiedFile>& 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;