D10663: Remove a partially copied file if copyjob was cancelled in the middle of file copying

Nathaniel Graham noreply at phabricator.kde.org
Thu Apr 26 21:03:01 UTC 2018


ngraham added a comment.


  In D10663#254549 <https://phabricator.kde.org/D10663#254549>, @dmitrio wrote:
  
  > Then I probably didn't understand what was proposed in the discussed bug report. When you start writing to the existing file the data that have been in the destination file before the operation become lost. If we want to be able to restore content of destination files after overwrite operation has started then we need to change the whole mechanism of file copying: we should copy source file to some temporary file, delete the destination file an rename temporary file to the destination file name.
  
  
  That's what it already does. Without your patch, canceling an overwrite is harmless because only the temporary file is deleted. In other words, the case in the bug is already handled for overwrite operations.
  
  The case that is NOT handled is for normal move/copy operations, where the destination file is not cleaned up after the job is canceled in the middle. Essentially, we want your patch to only delete the destination file when it's not an overwrite, because overwrites already clean up properly.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D10663

To: dmitrio, #frameworks, dfaure, ngraham
Cc: elvisangelaccio, ngraham, anthonyfieroni, meven, #frameworks, michaelh, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180426/7347afb4/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list