Common Lisp Package: TRIVIAL-SHELL

README:

FUNCTION

Public

EXIT (&OPTIONAL (CODE SUCCESS))

Exit the process. CODE is either a numeric exit code, or the special values :SUCCESS or :FAILURE, which maps to the appropriate exit codes for the operating system.

GET-ENV-VAR (NAME)

Return the value of the environment variable `name`.

Private

DIRECTORY-PATHNAME-P (PATHNAME)

Does `pathname` syntactically represent a directory? A directory-pathname is a pathname _without_ a filename. The three ways that the filename components can be missing are for it to be `nil`, `:unspecific` or the empty string.

OS-PROCESS-ID

Return the process-id of the currently executing OS process.

Undocumented

%EXIT (CODE)

%GET-ENV-VAR (NAME)

%OS-PROCESS-ID

%SHELL-COMMAND (COMMAND INPUT)

%SHELL-COMMAND-USING-TEMPORARY-FILE (COMMAND INPUT)

CREATE-SHELL-PROCESS (COMMAND WAIT)

FIND-COMMAND-ENDING-IN-STRING (COMMAND)

HOST-OS

OPEN-TEMPORARY-FILE

PROCESS-ALIVE-P (PROCESS)

PROCESS-EXIT-CODE (PROCESS)

READ-TEMPORARY-FILE (FILE-STREAM)

SYMBOL-IF-EXTERNAL (NAME PACKAGE)

MACRO

Public

WITH-TIMEOUT ((SECONDS) &BODY BODY)

Execute `body` for no more than `seconds` time. If `seconds` is exceeded, then a [timeout-error][] will be signaled. If `seconds` is nil, then the body will be run normally until it completes or is interrupted.

Private

WITH-INPUT ((VAR SOURCE &REST ARGS) &BODY BODY)

Create an input stream from source and bind it to var within the body of the with-input form. The stream will be closed if necessary on exit.

WITH-OUTPUT ((VAR DESTINATION &REST ARGS) &BODY BODY)

Create an output stream from source and bind it to var within the body of the with-output form. The stream will be closed if necessary on exit.

Undocumented

WITH-GENSYMS (SYMS &BODY BODY)

WITH-STREAM-FROM-SPECIFIER ((STREAM STREAM-SPECIFIER DIRECTION &REST ARGS) &BODY BODY)

GENERIC-FUNCTION

Public

Undocumented

SHELL-COMMAND (COMMAND &KEY INPUT)

Private

CLOSE-STREAM-SPECIFIER (STEAM)

Close a stream and handle other bookkeeping as appropriate.

FILE-TO-STRING-AS-LINES (PATHNAME)

MAKE-STREAM-FROM-SPECIFIER (SPECIFIER DIRECTION &REST ARGS)

Create and return a stream from specifier, direction and any other argsuments

VARIABLE

Public

*BOURNE-COMPATIBLE-SHELL*

The path to a Bourne compatible command shell in physical pathname notation.

Undocumented

*SHELL-SEARCH-PATHS*

Private

Undocumented

*OS-ALIST*

CONDITION

Public

TIMEOUT-ERROR

An error signaled when the duration specified in the [with-timeout][] is exceeded.