4 Working Beyond the Lisp Environment

4.2 Running UNIX programs from Lisp

The function run-program provides the ability to run UNIX programs from inside the Lisp environment. It has the following syntax:

run-program name&key :input :output :error-output :wait :arguments :if-input-does-not-exist :if-output-exists :if-error-output-exists

Four values are returned byrun-program:

1. The first value is a stream. If the value of either the:input or the:output keyword argument is:stream, that stream communicates with the running process and is the first value returned. If neither keyword is:stream,nil is returned.

2. If the:error-output keyword argument is:stream, the second value returned is the resulting input stream from which Lisp can read the program's error output; otherwise,nil is returned.

3. If the:wait keyword argument ist, the third value is the exit status of the program that was run. Otherwise, the exit status isnil.

4. If the program is running, the fourth value returned is the UNIX process id; otherwise,nil is returned.

4.2.1 - Keyword options
4.2.2 - Annotated examples
4.2.3 - Reference Pages

The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker