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!
CLISP ext:execute
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's documentation is mostly available as docstrings, e. g. here:
https://github.com/fare/asdf/blob/maste ... ogram.lisp
Code: Select all
(uiop:run-program "unzip zipfile.zip -d destinationdir/")
https://github.com/fare/asdf/blob/maste ... ogram.lisp