1 Introduction

EXTERNAL-PROGRAM enables running programs outside the Lisp process. It is an attempt to make the RUN-PROGRAM functionality in implementations like SBCL and CCL as portable as possible without sacrificing much in the way of power.

Returns, as multiple values, a keyword denoting the
status of the external process (one of ‘:RUNNING‘, ‘:STOPPED‘,
‘:SIGNALED‘, or ‘:EXITED‘), and the exit code or terminating signal
if the first value is other than ‘:RUNNING‘.

Sends the specified unix signal to the specified
external process. Signals an error if unsuccessful. The signal may
be either an integer, or one of the keywords in
‘EXTERNAL-PROGRAM::*SIGNAL-MAPPING*‘.

Runs the specified program in an external (Unix) process,
returning a process object if successful.

‘INPUT‘, ‘OUTPUT‘, and ‘ERROR‘ all behave similarly, accepting one of
the following values:

* ‘NIL‘, specifying that a null stream (e.g., ‘/dev/null‘) should be
used;
* ‘T‘, specifying that the ‘EXTERNAL-PROCESS‘ should use the source or
destination with which the Lisp was invoked;
* a stream;
* a pathname designator, to redirect to/from a file;
* ‘:STREAM‘, which creates a new stream opened for character input or
output (accessible via the ‘EXTERNAL-PROCESS-*-STREAM‘ functions);
or
* ‘:OUTPUT‘, (only available for ‘ERROR‘) which directs the error
output to the same destination as the standard output.

‘ENVIRONMENT‘ contains an alist mapping vars to values.

‘REPLACE-ENVIRONMENT-P‘ indicates whether the argument passed as ‘ENVIRONMENT‘
should replace or extend the current environment. The default is ‘NIL‘ (to
extend the environment).

‘STATUS-HOOK‘ is a function the system calls whenever the status of
the process changes. The function takes the process as an argument.