Ethereal-users: RE: [Ethereal-users] POPEN Query

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Munshi, Shahid K. (Manpower Contract)" <shahid.k.munshi@xxxxxx>
Date: Thu, 25 Sep 2003 11:07:08 -0500
The main odd to use POPEN on Windows is here.

import os,win32pipe
f = open ('Test.txt','w+')
x = win32pipe.popen("windump -l > Test.txt",'w+')
x.close()
f.close()

after executing this code, It complains about IOError at f = open ('Test.txt','w+') line. 
Any one can help?

-----Original Message-----
From: Guy Harris [mailto:guy@xxxxxxxxxxxx]
Sent: Wednesday, September 24, 2003 1:38 PM
To: Munshi, Shahid K. (Manpower Contract)
Cc: ethereal-users@xxxxxxxxxxxx
Subject: Re: [Ethereal-users] POPEN Query



On Sep 24, 2003, at 12:32 PM, Munshi, Shahid K. (Manpower Contract) 
wrote:

> But when I used
>
>
> import os,win32pipe
> TooMuchTime = 60
> x = win32pipe.popen("windump -l > Test.txt",'w+')
> w = time.time()
> TotalTime = time.time() + TooMuchTime
> while time.time() < TotalTime:
>         time.sleep(1.0)
>         print ".",
> x.close()
>
>
> this code and complied from command line , It does not write any data 
> in test.txt..

I have no idea why that happened, and have no time to investigate it.  
You're on your own for that one, unless somebody else has a suggestion.

> What is effective way for regular ("full") buffering rather than using 
> line buffering ( "-l") option of windump?

Regular buffering means it's even less likely that data will appear in 
the file after a short period of time passes.  There's nothing you can 
do to change that.