[Tutor] IOError with fcntl.ioctl

Alan G alan.gauld at freenet.co.uk
Wed Aug 17 18:47:39 CEST 2005

> Crave pardon if that question of mine was too basic to merit a 
> reply,

More likely it was too complex! :-)

That post would have been appropriate on comp.lang.python, this list 
usually more concerned with basic questions like "how does a while
loop work?"!

But we do usually try to answer the harder stuff, if you didn't
get a response sorry. I for one didn't even notice the original
post, not that I could have helped much! :-)

> It turns out that one needs to pass a 3rd parameter (and possibly a 
> 4th) if one expects a result value from calling ioctl. As documented 
> in fcntl.ioctl's pydoc, fcntl.ioctl() returns the result of calling 
> ioctl() which is just a 0 for success and -1 for error. Passing an 
> immutable sequence as the 3rd parameter will modify its behavior so 
> that it returns the expected arg value.

I'm glad you found the answer and thanks for taking the time to post 

Alan G
Author of the Learn to Program web tutor

More information about the Tutor mailing list