Skip to content

Commit

Permalink
local: revert to copy when moving file across file system boundaries –
Browse files Browse the repository at this point in the history
…fixes rclone#1176
  • Loading branch information
breunigs committed Aug 4, 2017
1 parent 230e653 commit 861e125
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 861e125

Please sign in to comment.