mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
vfs: Don't error a r/w file open without cache; delay error until Read called
If we open a file for r/w without the cache we now always return a handle and return an error if the file is ever read from. This fixes incompatibility with cmount under windows.
This commit is contained in:
@@ -56,6 +56,15 @@ func TestWriteFileHandleMethods(t *testing.T) {
|
||||
assert.Equal(t, int64(5), fi.Size())
|
||||
assert.Equal(t, "file1", fi.Name())
|
||||
|
||||
// Read
|
||||
var buf = make([]byte, 16)
|
||||
_, err = fh.Read(buf)
|
||||
assert.Equal(t, EPERM, err)
|
||||
|
||||
// ReadAt
|
||||
_, err = fh.ReadAt(buf, 0)
|
||||
assert.Equal(t, EPERM, err)
|
||||
|
||||
// Close
|
||||
assert.NoError(t, fh.Close())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user