func (w *Writes) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error { n, err := w.buf.Write(req.Data) resp.Size = n if err != nil { return err } return nil }
func (f *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error { f.mu.Lock() defer f.mu.Unlock() // expand the buffer if necessary /*newLen := req.Offset + int64(len(req.Data)) if newLen > int64(maxInt) { return fuse.Errno(syscall.EFBIG) } if newLen := int(newLen); newLen > len(f.data) { f.data = append(f.data, make([]byte, newLen-len(f.data))...) } n := copy(f.data[req.Offset:], req.Data)*/ n, e := f.r.Write(req.Data) if e != nil { return e } resp.Size = n return nil }
func (benchFile) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) error { resp.Size = len(req.Data) return nil }