Hello everyone,

I am trying to read (repeatedly) from named pipe (fifo) on linux (the
program will be a long running process...).

The following does not work, but if I remove the (while true , it
does...

(def pipe-name "/tmp/my-pipe")

(def buffer-size (* 1 1024))

(while true
       (with-open [pipe (new java.io.FileInputStream pipe-name)]
         (print pipe)
         (let [buffer (make-array Byte/TYPE buffer-size)]
           (. pipe read buffer)
           (map print buffer))))

I am lost here...

Vlad

PS: The new java.io.FileInputStream call blocks until the pipe is
closed at the "other" end...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to