[slime-devel] ECL's (ext:system) not working
markcox80 at gmail.com
Sun Feb 17 07:21:08 UTC 2013
On 17/02/2013, at 9:30 AM, Peter Münster wrote:
> What could I do please to make (ext:system) work with slime?
> No problem with CLISP's (ext:shell). No problem with ECL's (ext:system)
> outside of slime. But when evaluating `(ext:system "ls")' in slime, I
> get this error:
> --8<---------------cut here---------------start------------->8---
> :INPUT argument to RUN-PROGRAM does not have a file handle:
> #<a SWANK-BACKEND::SLIME-INPUT-STREAM>
> [Condition of type SIMPLE-ERROR]
Stas Boukarev is right. This is not Slime's problem, but ECL.
The stream arguments passed to EXT:RUN-PROGRAM
must have an underlying operating system file handle. What
EXT:RUN-PROGRAM does is fork(2) another process with the new process'
standard input, output and error streams bound to the file handle of
respective streams passed to EXT:RUN-PROGRAM.
This requirement is imposed by ECL's implementation of EXT:RUN-PROGRAM
and is not satisfied by SLIME-OUTPUT-STREAM. I have been meaning to
extend EXT:RUN-PROGRAM to support arbitrary Common Lisp streams, but I
have not got around to doing it.
To get around the problem now, you can do the following:
(let ((*standard-output* ext:+process-standard-output+)
The output of "/bin/ls" will be sent to the *inferior-lisp* buffer.
More information about the slime-devel