[plt-scheme] pipe-content-length: expects argument of type <pipe input port or output port>; given #<input-port:subprocess-stderr>

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed May 23 08:23:45 EDT 2007

At Tue, 22 May 2007 20:04:46 -0400, Kyle Smith wrote:
> At first I wasn't using the pipe-content-length procedure to inquire  
> about the
> port.   It was after isolating a problem I'm having, in the code  
> below, where the
> two threads were both blocking on a `read-char', instead of returning  
> eof as they
> should if there are no characters waiting to be read.  Since the two  
> ports are
> produced by the `subprocess' procedure, the doc indicates that they  
> are each attached
> to a pipe connected to stdout and stderr of the bash shell.  So, I  
> did a search on pipe
> in the help desk, and came up with `pipe-content-length' as a  
> possible means of
> diagnosing the problem.

`pipe-content-length' is supposed to work only on MzScheme pipes, which
are ports that are created by `make-pipe'. It doesn't work on ports
that are backed by OS pipes, such as the ones created by `subprocess'.
I'll have to make this much more clear in the docs.


Posted on the users mailing list.