Hi.
I'm running SLIME 2005-04-18 with CMUCL. If I execute
(run-program "ls" '("-la" "/bin") :output "lst")
The output of the linux ls command shows up in the file lst as expected. But if I try to direct it to the LISP terminal:
(run-program "ls" '("-la" "/bin") :output t)
(as described in the CMUCL documentation) all I get is
#<process 32578 :EXITED>
On the other hand, if I run CMUCL outside of SLIME, it works as advertised. So, where is the output going? And how can I capture it in a local variable?
Thanks.
--Jeff
Jeffrey Cunningham jeffrey@cunningham.net writes:
On the other hand, if I run CMUCL outside of SLIME, it works as advertised. So, where is the output going?
The output is probably in the *inferior-lisp* buffer. SLIME only redirects output to the Lisp level stream; output to the Unix file descriptor is currently not touched. We could redirect it, but I'm not sure whether that would be an advantage.
And how can I capture it in a local variable?
Maybe:
(with-output-to-string (s) (ext:run-program "ls" '("-la" "/bin") :output s) s)
Helmut.
Helmut,
with-output-to-string (s) works perfectly. Thanks!
-Jeff
On Mon May 02, 2005 at 06:50:42PM +0200, Helmut Eller wrote:
Jeffrey Cunningham jeffrey@cunningham.net writes:
On the other hand, if I run CMUCL outside of SLIME, it works as advertised. So, where is the output going?
The output is probably in the *inferior-lisp* buffer. SLIME only redirects output to the Lisp level stream; output to the Unix file descriptor is currently not touched. We could redirect it, but I'm not sure whether that would be an advantage.
And how can I capture it in a local variable?
Maybe:
(with-output-to-string (s) (ext:run-program "ls" '("-la" "/bin") :output s) s)
Helmut. _______________________________________________ slime-devel site list slime-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/slime-devel
--Jeff
On Mon, May 02, 2005 at 08:32:35PM -0700, Jeffrey Cunningham wrote:
with-output-to-string (s) works perfectly. Thanks!
Also, you can say
(ext:run-program "/bin/ls" '() :output *standard-output*)
to make it show up in the Slime REPL. It appears that by default run-program :output just passes the stdout Unix filehandle through to the other process, which obviously bypasses the magic Slime uses to pass the stream over the Slime protocol. Putting a stream in :output redirects it to a Lisp stream.
-bcd