Nash:
Couple of thoughts:
1. You could literally do a tail -f /logfile, e.g. with an exec process,
then process the results
2. You can use file.size() to see if the file has gotten longer since the
last read
3. You might want to implement a Thread, then use it's sleep method to do
the periodic checking
There are a couple of places in our Expresso framework that do those things,
might give some input/ideas at least. It's at http://www.javacorporate.com,
and the objects you might be able to use are:
1. com.javacorporate.common.util.OSProcess
2. com.javacorporate.common.html.HTMLLog
3. com.javacorporate.common.server.TimerServer
Where these objects implement the thoughts above.
Hope it helps.
Mike N
Javacorporate Ltd
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Java
List
Sent: Friday, September 03, 1999 2:51 PM
To: [EMAIL PROTECTED]
Subject: Servlet & java.io
Hi,
I'm tring to get my servlet to watch a UNIX log file and do something with
the results. Using java.io.FileReader and java.io.FileInputStream, it it
possible to watch the log as it's being created. For any UNIX people, I
want my servlet to do a "tail -f /logfile" and process the results on the
fly. The reading I've done on this list and on the java.io classes
hasn't given me enough info to make it happen. Any input (or links to
good www sites) to make this work is appreciated.
-Nash
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html