[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Controlling output of processes
From: |
Peter Bex |
Subject: |
Re: [Chicken-users] Controlling output of processes |
Date: |
Fri, 12 Mar 2010 17:24:03 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Mar 12, 2010 at 05:14:02PM +0100, Lasse Kliemann wrote:
> How can I start a process and control where it sends its stdout
> or stderr? I know that I can do:
>
> (receive
> (p-stdout p-stdin p-pid p-stderr)
> (process* command args)
> (...))
>
> This gives input and output ports connected to the process. But
> how can I express, e.g.: "everything available on port p-stdout
> should go to (current-output-port)"?
>
> Can you give me some suggestions?
(receive
(p-stdout p-stdin p-pid p-stderr)
(process* command args)
(with-input-from-port p-stdin (lambda () ....)))
See http://chicken.wiki.br/man/4/Unit%20ports
HTH,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth