Run an external program.
First argument PROGRAM is the program file name. Value is either a
string or a pathname. If PROGRAM is an absolute or explicit relative
file name, execute the specified file. Otherwise, search for it in
the standard program search path.
Second argument ARGUMENTS are the program arguments. Value is a list
of strings.
Keyword argument EXTRA-ARGUMENTS are additional program arguments.
Value is a list of strings. These arguments are appended to the
normal ARGUMENTS in a way similar to the 'xargs' utility. Use of
this keyword may result in multiple invocations of PROGRAM.
Keyword argument INPUT is the source for the program's standard input
stream. Value is either nil, t, :stream, a string, or a pathname.
Default is t and :stream is only valid if WAIT is nil.
Keyword argument IF-INPUT-DOES-NOT-EXIST specifies what to do if INPUT
names a non-existing file. Value is either :error, :create, or nil.
Default is :error.
Keyword argument OUTPUT is the destination for the program's standard
output stream. Value is either nil, t, :stream, a string, or a
pathname. Default is t and :stream is only valid if WAIT is nil.
Keyword argument IF-OUTPUT-EXISTS specifies what to do if OUTPUT names
an existing file. Value is either :error, :supersede, :append, or
nil. Default is :error.
Keyword argument ERROR specifies the destination for the program's
standard error stream. Value is either nil, t, :stream, a string, or
a pathname. Default is t and :stream is only valid if WAIT is nil.
Keyword argument IF-ERROR-EXISTS specifies what to do if ERROR names
am existing file. Value is either :error, :supersede, :append, or
nil. Default is :error.
If keyword argument WAIT is true, block the Lisp process and wait for
the program to terminate. Otherwise run the program asynchronously.
Default is true.
If INPUT names a non-existing file and IF-INPUT-DOES-NOT-EXIST is nil,
value is nil (no error). Likewise if OUTPUT/ERROR names an existing
file and IF-OUTPUT-EXISTS/IF-ERROR-EXISTS is nil. Otherwise, the
return value depends on the WAIT flag. If WAIT is true, value is the
program's exit status. Otherwise, value is an object representing the
external program.
For INPUT, OUTPUT, and ERROR, a value of nil means that the stream is
redirected to the null device, t means to inherit the stream from the
Lisp process, :stream means to create a new stream (only valid if WAIT
is nil), and a string or a pathname names a file.
For IF-INPUT-DOES-NOT-EXIST, a value of :error means to signal a file
error, :create means to create the file, and nil means to fail silently.
For IF-OUTPUT-EXISTS and IF-ERROR-EXISTS, a value of :error means to
signal a file error, :supersede means to create a new file with the
same name, :append means to modify the existing file at the end, and
nil means to fail silently.