Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

drive: create destination directory on Move()

Nick Craig-Woodc55402caa216
diff --git a/drive/drive.go b/drive/drive.go
index ec4b57d94..711a20cae 100644
--- a/drive/drive.go
+++ b/drive/drive.go
@@ -735,6 +735,12 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) {
return nil, errors.New("can't move a Google document")
}
+ // create the destination directory if necessary
+ err := f.dirCache.FindRoot(true)
+ if err != nil {
+ return nil, err
+ }
+
// Temporary Object under construction
dstObj, dstInfo, err := f.createFileInfo(remote, srcObj.ModTime(), srcObj.bytes)
if err != nil {