Implemented Read for watcher
This commit is contained in:
parent
083da5b3f0
commit
2c899b4660
4
fuse.go
4
fuse.go
@ -251,7 +251,9 @@ type sensorFileReadHandle struct {
|
||||
}
|
||||
var _ = (fs.FileReader)((*sensorFileReadHandle)(nil))
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user