Better tail -f

2002-04-02 Thread Bruno Figueira
Hi there, I have got the example of trailing a file from Perl Cookbook: --- for (;;) { while (FH) { print $_ } sleep 1; seek(FH, 0, 1); } --- However, if another program removes (all) lines from the file referenced by FH, perl looses the trailing (for a undetermined

RE: Better tail -f

2002-04-02 Thread Bruno Figueira
Well, I should not lock it. Actually, my code should be robust enough to workaround it and tail -f a file that is reseted sometimes. Cheers, Bruno -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Terça-feira, 2 de Abril de 2002 12:24 To: Figueira, Bruno

Socket closed connection

2002-04-01 Thread Bruno Figueira
Guys, How can I check if the remote peer closed my TCP connection? The following code is OK (taken from the book) because it expects something to come from the peer: use IO::Socket; $sock = new IO::Socket::INET (LocalHost = 'goldengate',

Trailing nasty files and sockets closing

2002-03-28 Thread Bruno Figueira
of it and it takes to much time (and to many lines lost) to re-synch with the file again. Question: How do I improve the trailing so that I wont miss lines when the file is rewritten? I have copied the code in this e-mail, since it's quite small. Regards, Bruno Figueira --- CodeFollows