"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
putio: fix server side copying over existing object
Nick Craig-Wood740f6b318c43
diff --git a/backend/putio/fs.go b/backend/putio/fs.goindex cc21cac00..cdd89ceba 100644--- a/backend/putio/fs.go+++ b/backend/putio/fs.go@@ -572,6 +572,17 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (o fs.Objecif err != nil {return nil, err}++ // We have successfully copied the file to random name+ // Check to see if file already exists first and delete it if so+ existingObj, err := f.NewObject(ctx, remote)+ if err == nil {+ err = existingObj.Remove(ctx)+ if err != nil {+ return nil, fmt.Errorf("server side copy: failed to remove existing file: %w", err)+ }+ }+err = f.pacer.Call(func() (bool, error) {params := url.Values{}params.Set("file_id", strconv.FormatInt(resp.File.ID, 10))