"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
vfs: Implement renaming of directories for backends without DirMove #2539
Nick Craig-Wood53a8b5a2754e
diff --git a/vfs/dir.go b/vfs/dir.goindex 82ff5693c..da857c70e 100644--- a/vfs/dir.go+++ b/vfs/dir.go@@ -10,6 +10,7 @@ import ("github.com/ncw/rclone/fs""github.com/ncw/rclone/fs/list"+ "github.com/ncw/rclone/fs/operations""github.com/ncw/rclone/fs/walk""github.com/pkg/errors")@@ -576,15 +577,15 @@ func (d *Dir) Rename(oldName, newName string, destDir *Dir) error {return err}case fs.Directory:- doDirMove := d.f.Features().DirMove- if doDirMove == nil {- err := errors.Errorf("Fs %q can't rename directories (no DirMove)", d.f)+ features := d.f.Features()+ if features.DirMove == nil && features.Move == nil && features.Copy == nil {+ err := errors.Errorf("Fs %q can't rename directories (no DirMove, Move or Copy)", d.f)fs.Errorf(oldPath, "Dir.Rename error: %v", err)return err}srcRemote := x.Remote()dstRemote := newPath- err = doDirMove(d.f, srcRemote, dstRemote)+ err = operations.DirMove(d.f, srcRemote, dstRemote)if err != nil {fs.Errorf(oldPath, "Dir.Rename error: %v", err)return err