Re: Tailing a file in Clojure

2010-12-05 Thread Miki
http://jnotify.sourceforge.net/ ? On Dec 3, 11:20 am, Stuart Sierra wrote: > On Dec 2, 10:55 pm, patrickdlogan wrote: > > > Java has a file watch API to avoid polling. Stuart Sierra uses it to > > good effect in lazytest. > > No, there is no such Java API that I am aware of.  Lazytest watches >

Re: Tailing a file in Clojure

2010-12-04 Thread ax2groin
Does any familiar with this NIO Watch service know if it handles NFS issues? We have an in-house log monitoring tool at work (doesn't everyone) which is written in Java, but the two big issues are message framing (knowing when a multi-line message has ended) and getting null bytes when tailing an N

Re: Tailing a file in Clojure

2010-12-03 Thread patrickdlogan
On Dec 3, 4:42 am, Alex Osborne wrote: > patrickdlogan writes: > > Java has a file watch API to avoid polling. > > I assume you're talking about the NIO 2 watch service?  That's not > yet in a released version of Java, it's coming in Java 7. oh I see. -- You received this message because you

Re: Tailing a file in Clojure

2010-12-03 Thread Alex Miller
This is being added with JSR 203 in Java 7: - http://java.dzone.com/articles/introducing-nio2-jsr-203-part-2 There was a backport for JDK 6 started: http://code.google.com/p/jsr203-backport/ but I don't think it's been touched in a couple years. On Dec 3, 1:20 pm, Stuart Sierra wrote: > On Dec

Re: Tailing a file in Clojure

2010-12-03 Thread Stuart Sierra
On Dec 2, 10:55 pm, patrickdlogan wrote: > Java has a file watch API to avoid polling. Stuart Sierra uses it to > good effect in lazytest. No, there is no such Java API that I am aware of. Lazytest watches the filesystem by polling. -S -- You received this message because you are subscribed t

Re: Tailing a file in Clojure

2010-12-03 Thread Alex Osborne
patrickdlogan writes: > Java has a file watch API to avoid polling. I assume you're talking about the NIO 2 watch service? That's not yet in a released version of Java, it's coming in Java 7. > Stuart Sierra uses it to good effect in lazytest. It looks to me like lazytest polls the last modif

Re: Tailing a file in Clojure

2010-12-03 Thread Saul Hazledine
On Dec 2, 8:53 am, viksit wrote: > Hi all, > > What would you recommend as the best method to tail a file using > Clojure? Are there any built in functions in contrib or core that > allow a program to read the last line of a file as it is appended to? > If not - how do people solve a problem like

Re: Tailing a file in Clojure

2010-12-02 Thread patrickdlogan
Java has a file watch API to avoid polling. Stuart Sierra uses it to good effect in lazytest. On Dec 2, 9:14 am, Alex Osborne wrote: > viksit writes: > > What would you recommend as the best method to tail a file using > > Clojure? Are there any built in functions in contrib or core that > > al

Re: Tailing a file in Clojure

2010-12-02 Thread kkw
Hi Viksit, For production support, I also wanted to "tail -f" a file on a Windows server with no "tail" facility (no one had installed the Windows Resource Kit yet, and executing the install file myself would've been prohibitive (it's a long story)). However, this Windows server did have Java.

Re: Tailing a file in Clojure

2010-12-02 Thread Alex Osborne
viksit writes: > What would you recommend as the best method to tail a file using > Clojure? Are there any built in functions in contrib or core that > allow a program to read the last line of a file as it is appended to? > If not - how do people solve a problem like this? > > My aim is simple -

Re: Tailing a file in Clojure

2010-12-02 Thread Ken Wesson
On Thu, Dec 2, 2010 at 2:53 AM, viksit wrote: > Hi all, > > What would you recommend as the best method to tail a file using > Clojure? Are there any built in functions in contrib or core that > allow a program to read the last line of a file as it is appended to? > If not - how do people solve a

Tailing a file in Clojure

2010-12-02 Thread viksit
Hi all, What would you recommend as the best method to tail a file using Clojure? Are there any built in functions in contrib or core that allow a program to read the last line of a file as it is appended to? If not - how do people solve a problem like this? My aim is simple - I've got a log file