This is a nice idea. The way Racket does it is to make
with-output-to-string cooperate with system:
(with-output-to-string (lambda () (system "date")))
but a quick check shows that Guile does not yet have such cooperation in
place. Would that be a good place to start looking?
Tony
On
Dear All ,
I've been encountering a few times the need for a procedure like
'system' or 'system*' but that might be capable of capturing the output
of the program that's being called.
While this is something that can be solved with a simple 'open-pipe*'
wrapper, the pattern seems relatively
Felix Lechner via "Bug reports for GUILE, GNU's Ubiquitous Extension Language"
writes:
> Hi,
>
> In an interesting (or perhaps maddening) inconsistency,
> 'with-output-to-port' captures stdout from system* here
>
> (call-with-output-file "/tmp/test.log"
> (lambda (port)
>
Hi,
In an interesting (or perhaps maddening) inconsistency,
'with-output-to-port' captures stdout from system* here
(call-with-output-file "/tmp/test.log"
(lambda (port)
(with-output-to-port
port
(lambda ()
(system* "mktemp" "-d")
but 'with-output-to-string' does