MCPcopy
hub / github.com/rclone/rclone / Move

Method Move

backend/crypt/crypt.go:677–691  ·  view source on GitHub ↗

Move src to this remote using server-side move operations. This is stored with the remote path given. It returns the destination Object and a possible error. Will only be called if src.Fs().Name() == f.Name() If it isn't possible then return fs.ErrorCantMove

(ctx context.Context, src fs.Object, remote string)

Source from the content-addressed store, hash-verified

675//
676// If it isn't possible then return fs.ErrorCantMove
677func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
678 do := f.Fs.Features().Move
679 if do == nil {
680 return nil, fs.ErrorCantMove
681 }
682 o, ok := src.(*Object)
683 if !ok {
684 return nil, fs.ErrorCantMove
685 }
686 oResult, err := do(ctx, o.Object, f.cipher.EncryptFileName(remote))
687 if err != nil {
688 return nil, err
689 }
690 return f.newObject(oResult), nil
691}
692
693// DirMove moves src, srcRemote to this remote at dstRemote
694// using server-side move operations.

Callers

nothing calls this directly

Calls 3

newObjectMethod · 0.95
FeaturesMethod · 0.65
EncryptFileNameMethod · 0.45

Tested by

no test coverage detected