【发布时间】:2014-06-28 19:07:45
【问题描述】:
我正在尝试从 ruby 中的输入设备读取事件。
然而
File.open('/dev/input/event9').read 16
返回异常:
Errno::EINVAL: Invalid argument @ io_fread - /dev/input/event9
from (pry):1:in `read'
IOdocumentation中read方法的签名解释了对fread方法的引用(ruby中的read调用C中对应的fread)。
但是,EINVAL 错误似乎是指发送到输入设备的错误建议,但我不太明白。
为了理解这个问题,我已经提交文件给用户组权限,但没有任何运气。
我的问题是:在我的情况下,“无效参数”错误意味着什么?
【问题讨论】:
-
顺便在 Arch 上使用 ruby 2.1.2
标签: ruby linux io linux-device-driver