Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

moveto, copyto: report transfers and checks as per move and copy

Nick Craig-Wooda61ba1e7c458
diff --git a/fs/operations.go b/fs/operations.go
index 520842a0e..91db8c0b4 100644
--- a/fs/operations.go
+++ b/fs/operations.go
@@ -1528,11 +1528,17 @@ func moveOrCopyFile(fdst Fs, fsrc Fs, dstFileName string, srcFileName string, cp
}
if NeedTransfer(dstObj, srcObj) {
- return Op(fdst, dstObj, dstFileName, srcObj)
- } else if !cp {
- return DeleteFile(srcObj)
+ Stats.Transferring(srcFileName)
+ err = Op(fdst, dstObj, dstFileName, srcObj)
+ Stats.DoneTransferring(srcFileName, err == nil)
+ } else {
+ Stats.Checking(srcFileName)
+ if !cp {
+ err = DeleteFile(srcObj)
+ }
+ defer Stats.DoneChecking(srcFileName)
}
- return nil
+ return err
}
// MoveFile moves a single file possibly to a new name