Create a file and open it with the flags passed in
(t *testing.T, create bool, filename string, flags int)
| 30 | |
| 31 | // Create a file and open it with the flags passed in |
| 32 | func 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 |
| 52 | func rwHandleCreateReadOnly(t *testing.T) (r *fstest.Run, vfs *VFS, fh *RWFileHandle) { |
no test coverage detected
searching dependent graphs…