Use *.partial~ as an intermediate file for copy
To resume copy after an interrupted attempt, a user would retry the same process again. To save time, one would skip all duplicate files. But unfortunately, it is almost guaranteed to have a single fragmented file that has a same name as an original file. This causes an incomplete copy, and normally the only way to solve this is to give up this method and remove all the files that are copied. This MR provides a way to do this properly by copying individual files into an intermediate file that is named
*.partial~. Only after the file is properly transfered, its name is changed to its original name. By this method, fragmented file is guaranteed to have a separate name, so a user can resume copy without a problem.