This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

CLISP ext:execute

2 posts · 2895 views

Hi, I am trying to execute an external program from CLISP on a Mac, but I am stuck. Does anybody have examples on how to use ext:execute or ext:run-program. What is the difference between the two (and also ext:run-shell-command). I find the documentation at http://www.clisp.org/impnotes/shell.html too confusing for a newbie like me.
In particular, I am trying to unzip a file to a given destination directory. I don't need portability, because I will be using it only with CLISP running on a Mac OS X.
I have tried (among many other things)

(ext:run-program "unzip zipfile.zip -d destinationdir/")

and I get

/bin/sh:/Users/User/unzip zipfile.zip -d destinationdir/: Cannot execute: no such file or directory

The zipfile.zip and destinationdir both do exist, I have also tried giving the absolute path to the files, so I suspect it is the unzip application that is not found.

Can anyone shed some light on this? Thank you very much!

Re: CLISP ext:execute

Actually you should try and use UIOP, a portable wrapper for OS-related functionality. It is a part of ASDF3 and should be available out of the box (you could also check if your *features* have ASDF3). The command would be then
(uiop:run-program "unzip zipfile.zip -d destinationdir/")
UIOP's documentation is mostly available as docstrings, e. g. here:
https://github.com/fare/asdf/blob/maste ... ogram.lisp