Hi,
On Darwin/PPC, When reading from a named pipe (you know, 'fifo'), EOF
never occurs even though the writer calls close() and is terminated. So
the read hangs. Any advice on hunting this bug down?
(I don't think this is exactly a Darwin bug, as I wrote a C program
which reads the pipe successfully, though Darwin seems to be anal about
catching SIGPIPE. But Ubuntu works fine.)
---------------------
(defun read-pipe (pipe-name)
(with-open-file (in pipe-name)
(loop with buffer = (make-array 1 :element-type 'character)
for i = (read-sequence buffer in)
while (> i 0)
do (format t "~A|" buffer)
do (force-output *standard-output*)))
(format t "~%** Exited ~S" 'read-pipe))
;; beforehand, execute:
;; mkfifo my-pipe
;; cat -u > my-pipe
;;
(read-pipe "my-pipe")
;; Now type stuff into cat, then exit it.
---------------------
Machine info:
(lisp-implementation-type) : SBCL
(lisp-implementation-version) : 0.9.12
(machine-type) : PowerPC
(machine-version) : NIL
(software-type) : Darwin
(software-version) : 8.6.0
Thanks for any help,
Tayssir
|