Open a file and if a new line is added then print it

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Open a file and if a new line is added then print it

gpatrick
Need to open a file and if a new line is appended, then I need to print it.

Opening the file is no problem and reading the contents, but how to check if a new line has been recently appended to the file so that new line can be appended?

I'd guess BufferedReader would be used in part?
Reply | Threaded
Open this post in threaded view
|

Re: Open a file and if a new line is added then print it

Mike Cowlishaw
 
> Need to open a file and if a new line is appended, then I
> need to print it.
>
> Opening the file is no problem and reading the contents, but
> how to check if a new line has been recently appended to the
> file so that new line can be appended?
>
> I'd guess BufferedReader would be used in part?

Compare its size to its size the last time you checked it?

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Open a file and if a new line is added then print it

gpatrick
Thank you