external-program

API Reference

external-program

EXTERNAL-PROGRAM

  • Generic-Function START (program args &key input if-input-does-not-exist output if-output-exists error if-error-exists environment replace-environment-p status-hook)
    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.
  • Method START ((program pathname) args &rest rest)
  • Method START ((program pathname) args &rest rest)
  • Method START ((program pathname) args &rest rest)
  • Generic-Function RUN (program args &key input if-input-does-not-exist output if-output-exists error if-error-exists environment replace-environment-p)
    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.
  • Method RUN ((program pathname) args &rest rest)
  • Method RUN ((program pathname) args &rest rest)
  • Method RUN ((program pathname) args &rest rest)
  • Generic-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*`.
  • Method SIGNAL-PROCESS (process signal)
  • Method SIGNAL-PROCESS (process signal)
  • Method SIGNAL-PROCESS (process signal)
  • Generic-Function PROCESS-ID (process)
    Returns the process id assigned to the external process by the operating system. This is typically a positive, 16-bit number.
  • Generic-Function PROCESS-INPUT-STREAM (process)
    Returns the stream created when the input argument to `START` is specified as `:STREAM`.
  • Generic-Function PROCESS-OUTPUT-STREAM (process)
    Returns the stream created when the output argument to `START` is specified as `:STREAM`.
  • Generic-Function PROCESS-ERROR-STREAM (process)
    Returns the stream created when the error argument to `START` is specified as `:STREAM`.
  • Generic-Function 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`.
  • Generic-Function PROCESS-P (process)
    `T` if object is a process, `NIL` otherwise.
  • Method RUN (program args &rest rest &key environment replace-environment-p &allow-other-keys)
  • Method START (program args &rest rest &key environment replace-environment-p &allow-other-keys)
  • Method SIGNAL-PROCESS (process (signal symbol))
  • Method SIGNAL-PROCESS (process (signal integer))
  • Method PROCESS-INPUT-STREAM (process)
  • Method PROCESS-OUTPUT-STREAM (process)
  • Method PROCESS-ERROR-STREAM (process)
  • Method PROCESS-STATUS (process)
  • Method PROCESS-ID (process)
  • Method PROCESS-P (process)