From a61ba1e7c458b31da31f485d4c7b1f97e69f6ac2 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 7 Jun 2017 13:02:21 +0100 Subject: [PATCH] moveto, copyto: report transfers and checks as per move and copy --- fs/operations.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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