mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 10:33:34 +00:00
local, yandex, dropbox: fix NewObject suceeding on a directory #1079
Add tests to make it consistent across all remotes
This commit is contained in:
@@ -162,6 +162,9 @@ func (f *Fs) newObjectWithInfo(remote string, info os.FileInfo) (fs.Object, erro
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if !o.info.Mode().IsRegular() {
|
||||
return nil, errors.Wrapf(fs.ErrorNotAFile, "%q", remote)
|
||||
}
|
||||
return o, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user