title: Why does select.select() work with disk files but not epoll()?
body: <p>The following code essentially cats a file with select.select():</p>
  
  <pre><code>f = open('node.py')
  fd = f.fileno()
  while True:
      r, w, e = select.select([fd], [], [])
      print '&gt;', repr(os.read(fd, 10))
      time.sleep(1)
  </code></pre>
  
  <p>When I try a similar thing with epoll I get an error:</p>
  
  <pre><code>self._impl.register(fd, events | self.ERROR)
  IOError: [Errno 1] Operation not permitted 
  </code></pre>
  
  <p>I've also read that epoll does not support disk files -- or perhaps that it doesn't make sense.</p>
  
  <p><a href="https://stackoverflow.com/questions/8057892/epoll-on-regular-files">Epoll on regular files</a></p>
  
  <p>But why does select() support disk files then?  I looked at the implementation in selectmodule.c and it seems to just be going through to the operating system, i.e. Python is not adding any special support.</p>
  
  <p>On a higher level I'm experimenting with the best way to serve static files in a nonblocking server.  I guess I will try creating I/O threads that read from disk and feed data to the main event loop thread that writes to sockets.</p>