Common Lisp Package: EXTERNAL-PROGRAM

README:

FUNCTION

Private

REFORMAT-ENVIRONMENT (ENVIRONMENT)

SBCL accepts vars as either ("FOO=meh" ...) or ((:foo . "meh") ...), but not (("FOO" . "meh") ...), so we build up the first kind (since the second kind is potentially lossy).

Undocumented

CONVERT-ENVIRONMENT (REST ENVIRONMENT REPLACE-ENVIRONMENT-P)

EMBED-ENVIRONMENT (PROGRAM ARGS ENVIRONMENT REPLACE-ENVIRONMENT-P)

MAKE-SHELL-STRING (PROGRAM ARGS ENVIRONMENT REPLACE-ENVIRONMENT-P)

RENAME-PARAMETER (FROM-NAME TO-NAME REST)

STRINGIFY-ARGS (ARGS)

GENERIC-FUNCTION

Public

PROCESS-ERROR-STREAM (PROCESS)

Returns the stream created when the error argument to `START` is specified as `:STREAM`.

PROCESS-ID (PROCESS)

Returns the process id assigned to the external process by the operating system. This is typically a positive, 16-bit number.

PROCESS-INPUT-STREAM (PROCESS)

Returns the stream created when the input argument to `START` is specified as `:STREAM`.

PROCESS-OUTPUT-STREAM (PROCESS)

Returns the stream created when the output argument to `START` is specified as `:STREAM`.

PROCESS-P (PROCESS)

`T` if object is a process, `NIL` otherwise.

PROCESS-STATUS (PROCESS)

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`.

RUN (PROGRAM ARGS &KEY INPUT IF-INPUT-DOES-NOT-EXIST OUTPUT IF-OUTPUT-EXISTS ERROR IF-ERROR-EXISTS ENVIRONMENT REPLACE-ENVIRONMENT-P &ALLOW-OTHER-KEYS)

Runs the specified program similarly to `START`, however it blocks and returns the external process status once the program exits. `:STREAM` is not a valid argument to `INPUT`, `OUTPUT`, or `ERROR` for this function.

SIGNAL-PROCESS (PROCESS SIGNAL)

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*`.

START (PROGRAM ARGS &KEY INPUT IF-INPUT-DOES-NOT-EXIST OUTPUT IF-OUTPUT-EXISTS ERROR IF-ERROR-EXISTS ENVIRONMENT REPLACE-ENVIRONMENT-P STATUS-HOOK &ALLOW-OTHER-KEYS)

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.

VARIABLE

Private

Undocumented

*SIGNAL-MAPPING*