Added FUSE support #55
4
fuse.go
4
fuse.go
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user