[Solved] Re: Opening a file in O_NONBLOCK mode

Ben Gertzfield che at debian.org
Fri May 12 04:16:38 CEST 2000


Oops. I hadn't looked closely enough at the os module; I found
that os.open will take os.O_RDONLY and os.O_NONBLOCK as
arguments. :)

I decided to go from:

fd = open(dev)

to:

fd = os.fdopen(os.open(dev, os.O_RDONLY | os.O_NONBLOCK))

I assume this'll be just about equivalent, which allows me to keep the
interface the same for my module (important to me!).

Ben

-- 
Brought to you by the letters D and O and the number 19.
"Nerd. Loser. Jerk. Moron. Worm. Scum. Idiot. Fool."
Debian GNU/Linux maintainer of Gimp and GTK+ -- http://www.debian.org/



More information about the Python-list mailing list