I have the script running fine here. Of course not knowing the content of 'somefile' I am randomly picking a text file as the substitute in my test.
I do suspect it has something to do with the 'tail' command. Perhaps you can try various versions to see if they are any different. I am using the version that comes with cygwin, and it simply works. Or could it be because I am running on Win NT4 and you are not? Other than that I can't really think of other possible cause of the problem.
Regards,
Arthur
At 09:32 AM 06/07/2001 +0100, Phil Harris wrote:
Arthur,
If you mean to add the second readline then the script already has that, I'd
shortened the script for clarity.
The problem is that it doesn;'t get past the first readline.
Someone has responded off-list so I'll try his suggestions first before
anymore questions.
Thanks anyway.
Phil
----- Original Message -----
From: Arthur Lee
To: Phil Harris ; [EMAIL PROTECTED]
Sent: Friday, July 06, 2001 7:29 AM
Subject: Re: popen usage
Perhaps it should have been the following? :
1: stdin=os.popen('tail -f somefile')
2: logline=re.compile('(.*?).*?- - \[(.*?)\] "(.*?) (.*?)" (.*?)
(.*?)"(.*?)" (.*?)".*')
3: a=stdin.readline()
4: print a
5: while a:
6: g=logline.search(a)
7: if not g: continue
8: a=stdin.readline()
Regards,
Arthur