Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Extract new lines from log file

by BrowserUk (Patriarch)
on Jan 02, 2007 at 19:55 UTC ( [id://592622]=note: print w/replies, xml ) Need Help??

in reply to Extract new lines from log file

Why not store the filesize instead of the line count? Then your 5 steps become

  1. Query filesize
  2. If the file has grown since last time, open the file and seek to the previous eof.
  3. Read the new lines and persist the new filesize.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://592622]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-22 23:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found