lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 17/10/12 18:06, Sam Roberts wrote:
Diego doesn't want to document capabilities that don't work the same
on linux and windows.
Sounds fair.

Btw, you cannot meaningfully select() on files in linux. You can
select from them, but they always
return readable,so selecting on an io object, or the fd from an io
object probably doesn't do what you want.

Hm, i must be missing something (again). I've done

local fd = nixio.open('/dev/ttyUSB0', nixio.open_flags('rdwr', 'nonblock'))

and fed it to nixio.poll(), and i'm pretty sure it hasn't busy waited on me. I would've noticed that on a OpenMoko (ARMv4) or an Asus520gu wifi router :)

Anotther example of stuff i've done and doesn't misbehave:

local fd = nixio.open('/dev/input/mice', nixio.open_flags('rdonly', 'sync'))

I know those flags arent available in Lua's io.open(), but that is not select's fault. Perhaps it's a select() vs poll() thing (don't think so)?

Jorge