Home > Archive > PERL POE > September 2007 > Wheel::FollowTail resume where it left off?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Wheel::FollowTail resume where it left off?
|
|
| Tom Lanyon 2007-07-30, 7:23 pm |
| Hi All,
Does anyone have a tricky way of using Wheel::FollowTail to watch
some logfiles, but be able to exit and then resume from the last
point? Is this even possible on a continually growing file?
Thanks,
Tom
| |
| Matt Sickler 2007-07-31, 7:24 pm |
| You could store the current byte position in another file. This would
only work as long as the file is only appended, if it is removed,
moved, or replaced, this would fail.
On 7/30/07, Tom Lanyon <tom@netspot.com.au> wrote:
> Hi All,
>
> Does anyone have a tricky way of using Wheel::FollowTail to watch
> some logfiles, but be able to exit and then resume from the last
> point? Is this even possible on a continually growing file?
>
> Thanks,
> Tom
>
| |
| Tom Lanyon 2007-07-31, 7:24 pm |
| Is there an easy way to get the current position in the file from
Wheel::FollowTail?
For a complete solution, could I do this as well as looking at the
file's inode number? If I re-open the file and it has a different
inode then I will know it's been replaced (eg, been moved to file.log.
0), and that I should look for it and any newer files?
On 01/08/2007, at 7:27 AM, Matt Sickler wrote:
[color=darkred]
> You could store the current byte position in another file. This would
> only work as long as the file is only appended, if it is removed,
> moved, or replaced, this would fail.
>
> On 7/30/07, Tom Lanyon <tom@netspot.com.au> wrote:
| |
| Tom Lanyon 2007-07-31, 7:24 pm |
| On 01/08/2007, at 7:31 AM, Tom Lanyon wrote:
> Is there an easy way to get the current position in the file from
> Wheel::FollowTail?
Whoops, dumb question.
$wheel->tell()
"Returns where POE::Wheel::FollowTail is currently in the log file.
tell() may be useful for s ing back into a file when resuming
tailing."
| |
|
|
|
|
|
|
|