Does anybody know if select.select() works with regular files or just with sockets/pipes?
I've tried on Solaris, Linux and Mac OS X - it doesn't block on select.select() call.
It just explodes my brain, trying something like this with no luck
import os
import select
fds = [ os.open("read.txt", os.O_RDONLY) ]
while True:
reads, _, _ = select.select(fds, [], [], 2.0)
if 0 < len(reads):
print "-> ",os.read(reads[0], 10)
else:
print "timeout"