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

local: revert to copy when moving file across file system boundaries – fixes #1176

Stefan Breunig861e125a4ff3
diff --git a/local/local.go b/local/local.go
index d8b71bfc7..965079673 100644
--- a/local/local.go
+++ b/local/local.go
@@ -472,8 +472,16 @@ func (f *Fs) Move(src fs.Object, remote string) (fs.Object, error) {
// Do the move
err = os.Rename(srcObj.path, dstObj.path)
- if err != nil {
+ if os.IsNotExist(err) {
+ // race condition, source was deleted in the meantime
+ return nil, err
+ } else if os.IsPermission(err) {
+ // not enough rights to write to dst
return nil, err
+ } else if err != nil {
+ // not quite clear, but probably trying to move a file across file system
+ // boundaries. Copying might still work.
+ return nil, fs.ErrorCantMove
}
// Update the info