Re: rebuffering an opened file

From: lallous (lallous_at_lgwm.org)
Date: 05/31/04


Date: Mon, 31 May 2004 11:27:14 +0300

Hello Fadi,

"Fadi Komati" <fadi.komati@act.com.lb> wrote in message
news:819af1a4.0405302333.1ab3fe45@posting.google.com...
> Dear All,
> I need your help concerning the following.
> I am openeing a log file for processing (I need to look for certain
> activities)
>
> obviously i keep reading until the end of file.
>
> What i need is the following: I need to be able to reload the file in
> order to read the entries added to the end of the file. Obviouly, i
> would like the file pointer to be positioned where i stopped reading .
>
> can anyone help me with this ( a small code sample would be
> marvelous). Or if you can tell me what function call to use in order
> to reread the file and thus see the changes.
>

You can for instance use an additional file to store the last file position
(seek position) you used, and then when you want to open the log file again,
read the file position from that additional file and directly seek to that
position and continue reading.

Hope that helps,
Elias


Quantcast