icotl and Pointers

Cliff Wells logiplexsoftware at earthlink.net
Fri Apr 5 18:19:42 EST 2002


On Fri, 05 Apr 2002 17:06:33 -0500
Umar Saif wrote:

> Hi,
> 	I am trying to write a piece of python code to control a sound device
(with 
> an oss driver).
>  The ioctls for the sound driver take in a pointer to an integer for the 
> argument -- I was wondering whether it is possible to do this in python ?
Or 
> writing a native library is the only way around this ?

This is from a fix sent to me for uspp by its author, Isaac Barona:

import struct
b = fcntl.ioctl(self.__handle, TERMIOS.TIOCINQ, struct.pack('i', 0))
n = struct.unpack('i', b)[0]

This is ugly but it works.

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308





More information about the Python-list mailing list