atistler has asked for the wisdom of the Perl Monks concerning the following question:
open (GWFILE, "/tmp/logfile"); #open (GWFILE, "/opt/logfile"); for (;;) { my $curpos; for ($curpos = tell(GWFILE); <GWFILE>; $curpos = tell(GWFILE)) { print; } # sleep for a while sleep 1; seek(GWFILE, $curpos, 0); # seek to where we had been }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tailing a log file using seek/tell
by ikegami (Patriarch) on Mar 16, 2007 at 23:26 UTC | |
by izut (Chaplain) on Mar 17, 2007 at 12:54 UTC | |
|
Re: Tailing a log file using seek/tell
by kunwon1 (Sexton) on Mar 16, 2007 at 23:05 UTC | |
|
Re: Tailing a log file using seek/tell
by rinceWind (Monsignor) on Mar 17, 2007 at 13:31 UTC | |
|
Re: Tailing a log file using seek/tell
by atistler (Acolyte) on Mar 19, 2007 at 07:00 UTC | |
by atistler (Acolyte) on Mar 19, 2007 at 07:02 UTC |