MCPcopy
hub / github.com/cubefs/cubefs / LargeFile

Method LargeFile

depends/jacobsa/fuse/samples/memfs/memfs_test.go:803–822  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

801}
802
803func (t *MemFSTest) LargeFile() {
804 var err error
805
806 // Create a file.
807 f, err := os.Create(path.Join(t.Dir, "foo"))
808 t.ToClose = append(t.ToClose, f)
809 AssertEq(nil, err)
810
811 // Copy in large contents.
812 const size = 1 << 24
813 contents := bytes.Repeat([]byte{0x20}, size)
814
815 _, err = io.Copy(f, bytes.NewReader(contents))
816 AssertEq(nil, err)
817
818 // Read the full contents of the file.
819 contents, err = ioutil.ReadFile(f.Name())
820 AssertEq(nil, err)
821 ExpectEq(size, len(contents))
822}
823
824func (t *MemFSTest) AppendMode() {
825 var err error

Callers

nothing calls this directly

Calls 6

NewReaderMethod · 0.80
CreateMethod · 0.65
JoinMethod · 0.65
CopyMethod · 0.65
ReadFileMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected