guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pipes and processes, stdin, stdout and stderr


From: Mark H Weaver
Subject: Re: Pipes and processes, stdin, stdout and stderr
Date: Sat, 18 Apr 2015 11:44:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Christopher Allan Webber <address@hidden> writes:

> Last night I was trying to do the equivalent of this:
>
>   bash$ echo "foo" | sha512sum
>
> in guile.  But I was unable to find a clear way to do it.
>
> I tried something like:
>
> (let* ((port (open-pipe*
>               OPEN_BOTH
>               "sha256sum" "--binary")))
>   (display "test me\n" port)
>   (force-output port)
>   (let ((result (drain-input port)))
>     (close-port port)
>     (car (string-split result #\space))))
>
> Unfortunately, this just hangs forever at the drain-input.  I get the
> same issue if I do (read-line port).
>
> What I expected was that Guile would provide a way to access stdin,
> stdout, stderr in a process as separate ports.

Indeed, this is exactly what we need.  It's been on my TODO list
for a while.

     Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]