MCPcopy Create free account
hub / github.com/brimdata/super / Put

Method Put

pkg/storage/file.go:36–43  ·  view source on GitHub ↗
(_ context.Context, u *URI)

Source from the content-addressed store, hash-verified

34}
35
36func (f *FileSystem) Put(_ context.Context, u *URI) (io.WriteCloser, error) {
37 path := u.Filepath()
38 if err := f.checkPath(path); err != nil {
39 return nil, fileErr(err)
40 }
41 w, err := pkgfs.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, f.perm)
42 return w, fileErr(err)
43}
44
45func (f *FileSystem) PutIfNotExists(_ context.Context, u *URI, b []byte) error {
46 path := u.Filepath()

Callers

nothing calls this directly

Calls 3

checkPathMethod · 0.95
fileErrFunction · 0.85
FilepathMethod · 0.45

Tested by

no test coverage detected