code: func (ms *FileMsgStore) setFile(fslice *fileSlice, offset int64) error {
  	var err error
  	file := fslice.file.handle
  	ms.writer = file
  	if file != nil && ms.bw != nil {
  		ms.writer = ms.bw.createNewWriter(file)
  	}
  	if offset == -1 {
  		ms.wOffset, err = file.Seek(0, io.SeekEnd)
  	} else {
  		ms.wOffset = offset
  	}
  	return err
  }
docs: // setFile sets the current data and index file.
  // The buffered writer is recreated.