code: func CreateSegment(dir string, k int) (*Segment, error) {
  	f, err := os.OpenFile(SegmentName(dir, k), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
  	if err != nil {
  		return nil, err
  	}
  	return &Segment{File: f, i: k, dir: dir}, nil
  }
docs: // CreateSegment creates a new segment k in dir.