[EMAIL PROTECTED] (Tim Daly Jr.) writes:

> [EMAIL PROTECTED] (Bj�rn Lindberg) writes:
> 
> > I have some difficulties with RUN-PROGRAM. It sometimes hangs when
> > using the :output :stream key parameter. I thought I had it traced
> > down to when a program only has output on stderr and not on stdout,
> > but that is not quite right either:
> ... 
> > At the places where I interrupt it, it is because it hangs, and
> > nothing happens. What is really strange is that giving -h or -1 (one)
> > as arguments seem to work, whereas -l (small L) makes it hang. If it
> > returns, reading from the output stream is not a problem. If I remove
> > the :output key argument, it does not hang either.
> 
> It sounds like it's deadlocking because ls wants to output to the
> stream, but the stream's buffer is full.  ls -l would produce more
> output than -h or -1 in most cases.  So you can probably pass :wait
> NIL to RUN-PROGRAM so that it returns before ls has exited, and read
> from the stream so ls can finish writing.

Ah, yes thank you. As you and others have pointed out, this was the
reason for it hanging. I didn't think of passing the :wait flag. In
general, I experience the run-program interface to be somewhat
confusing, especially the fact that several of the parameters are
dependant on each other. As a building block for higher level
constructs it works well though, and I suppose that is what it's
for. (Which is why I now have a with-output-from-process macro.)


Bj�rn


Reply via email to