title: python Non-block read file
body: <p>I want to read a file with non-block mode.
  So i did like below</p>
  
  <pre><code>import fcntl
  import os
  
  fd = open("./filename", "r")
  flag = fcntl.fcntl(fd.fileno(), fcntl.F_GETFD)
  fcntl.fcntl(fd, fcntl.F_SETFD, flag | os.O_NONBLOCK)
  flag = fcntl.fcntl(fd, fcntl.F_GETFD)
  if flag &amp; os.O_NONBLOCK:
      print "O_NONBLOCK!!"
  </code></pre>
  
  <p>But the value <code>flag</code> still represents 0.
  Why..? i think i should be changed according to <code>os.O_NONBLOCK</code></p>
  
  <p>And of course, if i call fd.read(), it is blocked at read().</p>