示例#1
0
文件: api.go 项目: Gibheer/datcrnch
func (a *Api) ReadData(d filestore.DataPoint) {
	f := filestore.OpenForRead(a.filename)
	defer f.Close()

	stat, _ := f.Stat()
	filesize := stat.Size()
	fmt.Println(filesize, d.Size(), filesize/d.Size())

	err := d.Read(f)
	if err != nil {
		fmt.Println("Error", err)
	}
}
示例#2
0
文件: api.go 项目: Gibheer/datcrnch
func (a *Api) WriteData(d filestore.DataPoint) {
	f := filestore.OpenForWrite(a.filename)
	defer f.Close()

	d.Write(f)
}