[slime-devel] ECL's (ext:system) not working

Mark Cox markcox80 at gmail.com
Sun Feb 17 07:21:08 UTC 2013


Hi Peter,

On 17/02/2013, at 9:30 AM, Peter Münster wrote:

> Hi,
> 
> 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+)
        (*standard-input* ext:+process-standard-input+)
        (*error-output* ext:+process-error-output+))
    (ext:system "/bin/ls"))

The output of "/bin/ls" will be sent to the *inferior-lisp* buffer.

Thanks
Mark



More information about the slime-devel mailing list