Buffer problem on SunOS

gaool gaool at caramail.com
Mon Nov 22 10:05:03 EST 2004


Hello,

I wrote a python script (python 2.3.3) to send some commands to a
programm and to show on the screen the responses of this programm. I
use "Pipedream.py" module in my script to speak with the programm
(under unix system, it uses fdopen() to create a pipe and to send the
specified string. fdopen has a buffer size argument).So I can specify
a buffer size when I send a command with the pipedream module.

On windows it works but on SunOS I have a buffer problem (may be it
would be te same on other unix system...). I don't see the response of
my program before the buffer (which buffer?) is full.

I tried to put differents values for the buffer size argument of the
Pipedream object:
0 (which means unbuffered), 1 (line buffered), and other values (which
create a buffer with the size of the specified value).

But it's always the same thing: if the responses of the program are
short, nothing append. I have to send a lot of commands to full the
buffer. And then I can see all the responses of the commands I send
before and the last response of the last send command.

If the responses of the send command are big, it fill the buffer and I
can see as much lines of the response as the buffer size. And I don't
see the rest of my response.

Apparently, it doesn't depend on the buffer size argument of Pipedream
module.

In fact, it seems that there is a SunOS buffer but I don't know its
size and what I have to do to set it or to delete it.

If you have any idea...

Best regards.



More information about the Python-list mailing list