Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the external-program Reference Manual, version 0.0.6, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 04:31:23 2022 GMT+0.
Next: Systems, Previous: The external-program Reference Manual, Up: The external-program Reference Manual [Contents][Index]
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.
Note: This library is available via Quicklisp.
Here are some of the differences:
START
(async) and RUN
(sync) into two separate functions, rather than using a single function with a WAIT
parameter that changes the function's specification;REPLACE-ENVIRONMENT-P
parameter that indicates whether provided env vars should build on or replace the current environment.Read the API documention for details. It’s a bit spartan, but should explain a lot.
Not all functionality is available on all platforms. EXTERNAL-PROGRAM
provides warnings and errors when these limitations are encountered. But I'll try my best to work around them.
There is currently at least some support for:
In addition to some implementations only providing blocking calls, some don’t use $PATH
– the ones that don’t won’t find bareword commands, you’ll need to use
Next: Files, Previous: Introduction, Up: The external-program Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Greg Pfeil <greg@technomadic.org>
LLGPL
0.0.6
trivial-features (system).
Next: Packages, Previous: Systems, Up: The external-program Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: external-program/external-program.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
external-program (system).
Next: external-program/utilities.lisp, Previous: external-program/external-program.asd, Up: Lisp [Contents][Index]
external-program (system).
*signal-mapping* (special variable).
Next: external-program/sbcl.lisp, Previous: external-program/external-program.lisp, Up: Lisp [Contents][Index]
external-program.lisp (file).
external-program (system).
Previous: external-program/utilities.lisp, Up: Lisp [Contents][Index]
utilities.lisp (file).
external-program (system).
convert-environment (function).
Next: Definitions, Previous: Files, Up: The external-program Reference Manual [Contents][Index]
Packages are listed by definition order.
Next: external-program-system, Previous: Packages, Up: Packages [Contents][Index]
common-lisp.
Previous: external-program, Up: Packages [Contents][Index]
Next: Indexes, Previous: Packages, Up: The external-program Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Previous: Public Interface, Up: Public Interface [Contents][Index]
Returns the stream created when the error argument to ‘START‘ is specified as ‘:STREAM‘.
Returns the process id assigned to the external
process by the operating system. This is typically a positive,
16-bit number.
Returns the stream created when the input argument to ‘START‘ is specified as ‘:STREAM‘.
Returns the stream created when the output argument to ‘START‘ is specified as ‘:STREAM‘.
‘T‘ if object is a process, ‘NIL‘ otherwise.
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‘.
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.
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.
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Ordinary functions, Previous: Internals, Up: Internals [Contents][Index]
Previous: Special variables, Up: Internals [Contents][Index]
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).
Previous: Definitions, Up: The external-program Reference Manual [Contents][Index]
Jump to: | C E F G M P R S |
---|
Jump to: | C E F G M P R S |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*signal-mapping* : | Private special variables | ||
| |||
S | |||
Special Variable, *signal-mapping* : | Private special variables | ||
|
Jump to: | *
S |
---|
Jump to: | E F P S U |
---|
Jump to: | E F P S U |
---|