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

This commit is contained in:
Nick Craig-Wood 2017-06-07 13:02:21 +01:00
parent d30cc1e119
commit a61ba1e7c4

View File

@ -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