This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: none
- To: jimb at red-bean dot com
- Subject: Re: none
- From: Gary Houston <ghouston at arglist dot com>
- Date: 21 Mar 2000 21:48:02 -0000
- CC: val at kamysh dot materials dot kiev dot ua, guile at sourceware dot cygnus dot com
- References: <200003211428.IAA13689@sanpietro.red-bean.com> <m3og88ta1m.fsf@savonarola.red-bean.com>
> From: Jim Blandy <jimb@red-bean.com>
> Date: 21 Mar 2000 14:09:25 -0500
>
> > Hello,
> >
> > is it supposed, that
> >
> > (display "Hello, world!"
> > (open-output-pipe "mimencode"))
> >
> > should write `SGVsbG8uIHdvcmxkIQ==' to the `current-output-port'?
> >
> > It does not.
> >
> > It seems, it writes to the "stdout", but I do not understand, how to
> > get these data back to guile (in interactive mode, I see the output
> > only after finishing guile session).
> >
> > I would be very appreciated for any help.
>
> It's a buffering issue. If you close the port, or apply force-output
> to it, then mimencode will recieve the data.
>
> Of course, mimencode isn't obliged to actually write anything at all
> to its stdout until it sees EOF, so in general, you'll need to close
> the port before you get any results.
More likely a mimencode issue than a buffering issue. The port you
get from open-output-pipe isn't buffered:
guile> (use-modules (ice-9 popen))
guile> (define p (open-output-pipe "cat"))
guile> (port-mode p)
"w0"
guile> (display "foo" p)
guile> foo