MCPcopy
hub / github.com/rclone/rclone / rwHandleCreateFlags

Function rwHandleCreateFlags

vfs/read_write_test.go:32–49  ·  view source on GitHub ↗

Create a file and open it with the flags passed in

(t *testing.T, create bool, filename string, flags int)

Source from the content-addressed store, hash-verified

30
31// Create a file and open it with the flags passed in
32func rwHandleCreateFlags(t *testing.T, create bool, filename string, flags int) (r *fstest.Run, vfs *VFS, fh *RWFileHandle) {
33 opt := vfscommon.Opt
34 opt.CacheMode = vfscommon.CacheModeFull
35 opt.WriteBack = writeBackDelay
36 r, vfs = newTestVFSOpt(t, &opt)
37
38 if create {
39 file1 := r.WriteObject(context.Background(), filename, "0123456789abcdef", t1)
40 r.CheckRemoteItems(t, file1)
41 }
42
43 h, err := vfs.OpenFile(filename, flags, 0777)
44 require.NoError(t, err)
45 fh, ok := h.(*RWFileHandle)
46 require.True(t, ok)
47
48 return r, vfs, fh
49}
50
51// Open a file for read
52func rwHandleCreateReadOnly(t *testing.T) (r *fstest.Run, vfs *VFS, fh *RWFileHandle) {

Calls 4

newTestVFSOptFunction · 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…