MCPcopy
hub / github.com/rclone/rclone / readHandleCreate

Function readHandleCreate

vfs/read_test.go:15–27  ·  view source on GitHub ↗

Open a file for write

(t *testing.T)

Source from the content-addressed store, hash-verified

13
14// Open a file for write
15func readHandleCreate(t *testing.T) (r *fstest.Run, vfs *VFS, fh *ReadFileHandle) {
16 r, vfs = newTestVFS(t)
17
18 file1 := r.WriteObject(context.Background(), "dir/file1", "0123456789abcdef", t1)
19 r.CheckRemoteItems(t, file1)
20
21 h, err := vfs.OpenFile("dir/file1", os.O_RDONLY, 0777)
22 require.NoError(t, err)
23 fh, ok := h.(*ReadFileHandle)
24 require.True(t, ok)
25
26 return r, vfs, fh
27}
28
29// read data from the string
30func readString(t *testing.T, fh *ReadFileHandle, n int) string {

Callers 5

TestReadFileHandleSeekFunction · 0.85
TestReadFileHandleReadAtFunction · 0.85
TestReadFileHandleFlushFunction · 0.85

Calls 4

newTestVFSFunction · 0.85
WriteObjectMethod · 0.80
CheckRemoteItemsMethod · 0.80
OpenFileMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…