From 15a1fa14e9b89c471615ed224c722ec45c5c48b0 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 21 Oct 2017 12:51:46 -0400 Subject: [PATCH] a comment about the new saving procedure --- src/DirManager.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/DirManager.cpp b/src/DirManager.cpp index d7e2436fe..57ad21f71 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -577,6 +577,23 @@ bool DirManager::SetProject(wxString& newProjPath, wxString& newProjName, const // Commit changes to filenames in the BlockFile objects, and removal // of files at old paths, ONLY NOW! This must be nothrow. + + // This copy-then-delete procedure is needed to make it safe to + // attempt save to another storage device, but fail. + + // It has the consequence that saving a project from one part of + // the device to another will not succeed unless there is sufficient + // space to hold originals and copies at the same time. Perhaps the + // extra cautions are not needed in that case, and the old procedure + // of renaming first, and reversing the renamings in case of failure, + // could still work safely. + + // But I don't know whether wxWidgets gives us a reliable means to + // distinguish that case. + + // I will err on the side of safety and simplicity and follow the + // same procedure in all cases. + size_t ii = 0; for (const auto &pair : mBlockFileHash) {