This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: none


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]