Reputation: 3452
Whats is the best way to execve() from lisp code in SBCL lisp implementation? Or maybe there is one good way working with all implementations?
Upvotes: 2
Views: 298
Reputation: 1767
There is external-program that provides a portable way to run well... external programs in Common Lisp. It does the job for me, abstracting away the trivialities of the various interfaces provided by compilers is often a good choice, and in regard to the time execve
will take the "performance" loss if there is any is really not relevant here.
If you really only target SBCL you have sb-ext:run-program which is really a complicated execve. In my experience it still runs programs through /bin/sh and may do PATH lookup anyway so it might not end up being exactly an execve.
Upvotes: 2