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)
| 811 | // |
| 812 | // If it isn't possible then return fs.ErrorCantMove |
| 813 | func (f *Fs) Move(ctx context.Context, src fs.Object, remote string) (fs.Object, error) { |
| 814 | dstFs := f |
| 815 | |
| 816 | //log.Printf("Move %q -> %q", src.Remote(), remote) |
| 817 | srcObj, ok := src.(*Object) |
| 818 | if !ok { |
| 819 | fs.Debugf(src, "Can't move - not same remote type") |
| 820 | return nil, fs.ErrorCantMove |
| 821 | } |
| 822 | |
| 823 | // Do the move |
| 824 | err := f.move(ctx, remote, srcObj.fs, srcObj.remote, srcObj.info) |
| 825 | if err != nil { |
| 826 | return nil, err |
| 827 | } |
| 828 | |
| 829 | // Create a destination object |
| 830 | dstObj := &Object{ |
| 831 | fs: dstFs, |
| 832 | remote: remote, |
| 833 | info: srcObj.info, |
| 834 | } |
| 835 | return dstObj, nil |
| 836 | } |
| 837 | |
| 838 | // DirMove moves src, srcRemote to this remote at dstRemote |
| 839 | // using server-side move operations. |