Implemented Read for watcher

This commit is contained in:
Yannick Ulrich 2023-02-26 19:04:47 +00:00
parent 083da5b3f0
commit 2c899b4660

View File

@ -251,7 +251,9 @@ type sensorFileReadHandle struct {
} }
var _ = (fs.FileReader)((*sensorFileReadHandle)(nil)) var _ = (fs.FileReader)((*sensorFileReadHandle)(nil))
func (fh *sensorFileReadHandle) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno) { func (fh *sensorFileReadHandle) Read(ctx context.Context, dest []byte, off int64) (fuse.ReadResult, syscall.Errno) {
return nil, 0 v := <-fh.ch
content := []byte(strconv.Itoa(int(v)) + "\n")
return fuse.ReadResultData(content), 0
} }