[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: open-input-output-process, open-input-output-pipe
From: |
Gary Houston |
Subject: |
Re: open-input-output-process, open-input-output-pipe |
Date: |
20 Mar 2001 08:28:56 -0000 |
> From: Rob Browning <address@hidden>
> Date: 19 Mar 2001 12:56:53 -0600
>
> Mikael Djurfeldt <address@hidden> writes:
>
> > I'd find something like the patch below useful. The procedures
> > below return a pair of an input and output port instead of the
> > input-output port which is stated in the comment. How would one go
> > about implementing it as intended, i.e. with an input-output-port?
>
> I agree that having something like this would be useful since I wrote
> something very similar lately :>.
Ha, I wonder now if is there anyone on guile-devel who has not :)
> I originally implemented it with one io-port too, but for some reason
> (probably a misunderstanding on my part), never did quite get it to
> work right. In the end I settled on returning (list pid to-child-port
> from-child-port stderr-port). This seems perhaps better than just one
> two-way port anyway, if you want to handle stderr. (Actually, right
> now, in my code, stderr isn't really hooked up, yet).
I forgot earlier to mention ptys. If we got pty support back into
guile-core it would probably be the best one-port solution. ptys
help with programs like ftp clients that act differently when taking
input from a pipe.
> > + (set-batch-mode?! #t)
> > + (close-all-ports-except (cdr from) (car to))
>
> Didn't know about these, but they're obviously appropriate...
close-all-ports-except is now deprecated in CVS.
> > + (pipe-guardian (car port))
>
> I didn't realize we had pipe-guardians. Is there any documentation
> around?
Take a look at ice-9/popen.scm in CVS. Mikaels code is written to go
in there.
> > + (hashq-set! port/pid-table (car port) (cdr port/pid))
>
> Another bit I didn't know I needed to add. Is there documentation for
> how this is supposed to be handled?
Take a look at ice-9/popen.scm in CVS.