Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!postnews.google.com!ct4g2000vbb.googlegroups.com!not-for-mail From: www Newsgroups: comp.lang.java.programmer Subject: a program process a constantly updated file Date: Fri, 17 Jun 2011 10:15:46 -0700 (PDT) Organization: http://groups.google.com Lines: 21 Message-ID: <885b80e6-864a-4076-b559-65b2452ffe9f@ct4g2000vbb.googlegroups.com> NNTP-Posting-Host: 205.156.36.55 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1308331066 28492 127.0.0.1 (17 Jun 2011 17:17:46 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Jun 2011 17:17:46 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: ct4g2000vbb.googlegroups.com; posting-host=205.156.36.55; posting-account=oo44OQoAAABMDvaRlaO3SeQ5MVbxqLdH User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1,gzip(gfe) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5349 Dear All: I need to write a Java program(since I am a Java developer) to do the following task: A commercial program sends out information to its log file once in a while. ANYTIME when a new line is inserted to the bottom of the log file, I want my Java program IMMEDIATELY(10~20 seconds delay is acceptable) read that new line, process it and do some other stuff based on the string in the new line. The commercial program is constantly running in Windows 7 24 hours a day 7 days a week. So my Java program needs always be running and waiting for any new line shows up in the log file. I have never developed such a Java program that runs all the time and wait for the update of a file. I can do the regular Java IO stuff. But I hate every second let the Java program open the log file and read it from the top to the bottom. That will occupy the computer CPU. I am wondering if there are some smart tools for this kind of purpose. Thank you very much.