MCPcopy
hub / github.com/rclone/rclone / Copy

Method Copy

backend/crypt/crypt.go:652–666  ·  view source on GitHub ↗

Copy src to this remote using server-side copy 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.ErrorCantCopy

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

Source from the content-addressed store, hash-verified

650//
651// If it isn't possible then return fs.ErrorCantCopy
652func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, error) {
653 do := f.Fs.Features().Copy
654 if do == nil {
655 return nil, fs.ErrorCantCopy
656 }
657 o, ok := src.(*Object)
658 if !ok {
659 return nil, fs.ErrorCantCopy
660 }
661 oResult, err := do(ctx, o.Object, f.cipher.EncryptFileName(remote))
662 if err != nil {
663 return nil, err
664 }
665 return f.newObject(oResult), nil
666}
667
668// Move src to this remote using server-side move operations.
669//

Callers

nothing calls this directly

Calls 3

newObjectMethod · 0.95
FeaturesMethod · 0.65
EncryptFileNameMethod · 0.45

Tested by

no test coverage detected