reading a growing log file

Discussion in 'Perl' started by seabass, Oct 5, 2003.

  1. seabass

    seabass Guest

    i need to read events from a log file as they are being logged. using
    the cookbook i added the following to my script:

    for (;;) {
    while (<FH>) { .... }
    sleep $SOMETIME;
    seek(FH, 0, 1);
    }

    this does not work correctly. when sending 15,000 lines to the log file
    only 14,938 are processed.

    if anyone has any ideas on either how to fix this or a better way to do
    it i am all ears.

    tia!

    -dj
    seabass, Oct 5, 2003
    #1
    1. Advertising

  2. seabass

    seabass Guest

    figured out that the problem was with the data and not the script

    seabass wrote:
    > i need to read events from a log file as they are being logged. using
    > the cookbook i added the following to my script:
    >
    > for (;;) {
    > while (<FH>) { .... }
    > sleep $SOMETIME;
    > seek(FH, 0, 1);
    > }
    >
    > this does not work correctly. when sending 15,000 lines to the log file
    > only 14,938 are processed.
    >
    > if anyone has any ideas on either how to fix this or a better way to do
    > it i am all ears.
    >
    > tia!
    >
    > -dj
    >
    seabass, Oct 5, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mahesh Prasad
    Replies:
    1
    Views:
    706
    Tom Wells
    Feb 22, 2004
  2. Amratash
    Replies:
    0
    Views:
    519
    Amratash
    Apr 13, 2004
  3. Aspiring .NET Programmer
    Replies:
    6
    Views:
    396
    Aspiring .NET Programmer
    Oct 4, 2006
  4. unomystEz
    Replies:
    0
    Views:
    548
    unomystEz
    Nov 19, 2006
  5. Nigel
    Replies:
    11
    Views:
    178
    Thrill5
    May 16, 2009
Loading...

Share This Page