Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder3.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!news.glorb.com!postnews.google.com!eq2g2000vbb.googlegroups.com!not-for-mail From: www Newsgroups: comp.lang.java.programmer Subject: Re: a program process a constantly updated file Date: Fri, 17 Jun 2011 10:43:01 -0700 (PDT) Organization: http://groups.google.com Lines: 13 Message-ID: References: <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 1308332581 11794 127.0.0.1 (17 Jun 2011 17:43:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 17 Jun 2011 17:43:01 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: eq2g2000vbb.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:5350 Just one more note: the commercial program outputs something to the log file probably once in a couple hours. It is not very active. If the log file has been updated, within one minute range, the Java program needs to read the newly inserted line. So, my plan right now is for every 60 seconds, let the Java program check if the log file has been changed. If not, do nothing; If the file has been changed(within the past 60 seconds, one or several lines have been added to the bottom of the log file), open and read the log file, from top to the bottom, retrieve the new lines... I am just wondering if there is better way to do this.