This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
shell-command-to-string
- To: guile@cygnus.com
- Subject: shell-command-to-string
- From: thi <ttn@mingle.glug.org>
- Date: Sun, 6 Jun 1999 16:54:28 -0700
- Reply-to: ttn@netcom.com
hmmm, are there any other implementations of this?
just wondering,
thi
--------------------
(define (shell-command-to-string cmd)
(with-output-to-string
(lambda ()
(let ((in-port (open-input-pipe cmd)))
(let loop ((line (read-line in-port 'concat)))
(or (eof-object? line)
(begin
(display line)
(loop (read-line in-port 'concat)))))))))