moveto, copyto: report transfers and checks as per move and copy
This commit is contained in:
parent
d30cc1e119
commit
a61ba1e7c4
1 changed files with 10 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue