[gambit-list] open-input-file, read and fifos

Adrien Pierard pierarda at iro.umontreal.ca
Fri Feb 1 06:33:19 EST 2008


First question is "how comes reading a fifo isn't blocking?"

% cd /tmp
% mkfifo fifo
% cat > test.scm
(let ((fifo-port (open-input-file "/tmp/fifo")))
  (pretty-print (read fifo-port))
    (close-port fifo-port))
 
% gsi test.scm
#!eof
% echo "hello" > fifo&
[1] 70455
% gsi test.scm
[1]  + done       echo "hello" > fifo
hello


Second question is "Why do I often have a 'device not configured' error
with code like the one above?" (Bug not reproduced here, but often happens
when I try to read or open where nothing is currently being written yet.)

Finally, I would like to know whether we could have a procedure
WITH-ERROR-TO-FILE to redirect the error port too.


Regards,

Adrien


-- 
"I am not a Church numeral; I am a free variable!"
(The Scheme Underground)
For every complex problem, there is a solution that is simple, neat, and wrong.



More information about the Gambit-list mailing list