Example #1
0
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)
	}
}
Example #2
0
func (a *Api) WriteData(d filestore.DataPoint) {
	f := filestore.OpenForWrite(a.filename)
	defer f.Close()

	d.Write(f)
}