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

Re: Tailing a file in Clojure

2010-12-03 Thread Alex Osborne
patrickdlogan patrickdlo...@gmail.com 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

Re: Tailing a file in Clojure

2010-12-03 Thread Stuart Sierra
On Dec 2, 10:55 pm, patrickdlogan patrickdlo...@gmail.com 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

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

Re: Tailing a file in Clojure

2010-12-03 Thread patrickdlogan
On Dec 3, 4:42 am, Alex Osborne a...@meshy.org wrote: patrickdlogan patrickdlo...@gmail.com 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

Re: Tailing a file in Clojure

2010-12-03 Thread Saul Hazledine
On Dec 2, 8:53 am, viksit vik...@gmail.com 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

Re: Tailing a file in Clojure

2010-12-02 Thread Ken Wesson
On Thu, Dec 2, 2010 at 2:53 AM, viksit vik...@gmail.com 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

Re: Tailing a file in Clojure

2010-12-02 Thread Alex Osborne
viksit vik...@gmail.com 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

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. I

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 a...@meshy.org wrote: viksit vik...@gmail.com writes: What would you recommend as the best method to tail a file using Clojure? Are there any built in functions in