The org.melusina.rashell Reference Manual

This is the org.melusina.rashell Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:23:00 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 org.melusina.rashell

Resilient replicant Shell Programming Library for Common Lisp

Author

Michaël Le Barbier

License

MIT

Dependencies
  • alexandria (system).
  • cl-ppcre (system).
  • parse-float (system).
  • sb-posix (system).
Source

org.melusina.rashell.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 org.melusina.rashell/src

Source

org.melusina.rashell.asd.

Parent Component

org.melusina.rashell (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 org.melusina.rashell/org.melusina.rashell.asd

Source

org.melusina.rashell.asd.

Parent Component

org.melusina.rashell (system).

ASDF Systems

org.melusina.rashell.


4.1.2 org.melusina.rashell/src/package.lisp

Source

org.melusina.rashell.asd.

Parent Component

src (module).

Packages

org.melusina.rashell.


4.1.3 org.melusina.rashell/src/util.lisp

Source

org.melusina.rashell.asd.

Parent Component

src (module).

Internals

4.1.4 org.melusina.rashell/src/rashell.lisp

Source

org.melusina.rashell.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.5 org.melusina.rashell/src/posix.lisp

Source

org.melusina.rashell.asd.

Parent Component

src (module).

Public Interface
Internals

4.1.6 org.melusina.rashell/src/mktemp.lisp

Source

org.melusina.rashell.asd.

Parent Component

src (module).

Public Interface
Internals

mktemp-template (function).


5 Packages

Packages are listed by definition order.


5.1 org.melusina.rashell

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Special variables

Special Variable: *mktemp-designator*

If set, this parameter is a prefix used when generating temporary file templates.

This can be used to distinguish temporary filenames with a prefix mentioning the application that generated them or an issue number.

Package

org.melusina.rashell.

Source

mktemp.lisp.

Special Variable: *mktemp-keep*

If set, temporary files and directories are not deleted.

Package

org.melusina.rashell.

Source

mktemp.lisp.

Special Variable: *query-output-line-number*

This variable is bound in the main loop of DO-QUERY and exposes the output line number.

Package

org.melusina.rashell.

Source

rashell.lisp.


6.1.2 Macros

Macro: define-command (name argv options spec)

Define a function NAME that makes a command according to SPEC.

The function NAME accepts arguments ARGV and optional arguments as specified by the OPTIONS parameter, see below. The SPEC parameter is a property list specifiying various aspects of how the command is run.

The OPTIONS parameter is a list of option specifications. An option specification is a list starting with a symbol, the OPTION-NAME, which is used to label the optional parameter of the function NAME. The allowed forms for option specifications are:

(OPTION-NAME :flag FLAG-STRING)
The parameter OPTION-NAME is interpreted as a generalised boolean. When it is set, the FLAG-STRING is added to the command-lin of the external program being run.

(OPTION-NAME :option OPTION-STRING [:to-string CONVERT] [:multiple MULTIPLE-FLAG]) The parameter OPTION-NAME is interpreted as an arbitrary value is a string, or
is converted to a string either by applying the function passed as the :TO-STRING property, or by using ‘WRITE-TO-STRING’ if none of the preceeding rules apply.

When set, the MULTIPLE-FLAG makes the OPTION-NAME accept a list or a single value. The elements of this list are converted to strings as described above and each of the resulting string is added to the command line, preceded by OPTION-STRING.

The SPEC is a property list where the following properties are allowed:

:PROGRAM PATH-TO-PROGRAM
The path to the program run by the function NAME.

:SUBCOMMAND SUBCOMMAND
A SUBCOMMAND is a word or a list of words written after the PATH-TO-PROGRAM
and before other options in the argument vector. Some programs, like ‘git’,
‘svn’, ‘pkg’, ‘port’, ‘docker’ for instance use this calling convention and
some refer to this part of the command line as a subcommand.

:REFERENCE
A reference to be added to the documentation.

:DOCUMENTATION
A documentation string for NAME.

:REST
A form to evalute in order to produce remaining arguments on the command line.
(The arguments are sometimes denoted as “rest arguments.”

:OBJECT-OF-OUTPUT-LINE
When provided, a function to interpret output of the program as an object stream. The provided function should convert a trimmed output line to the desired value. The conversion is only used when operating the command as a query.

When this function returns a second value equal to :DROP, the returned value should be dropped from the stream.

See ‘DO-QUERY’, ‘RUN-QUERY’ and ‘DEFINE-QUERY’.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: define-filter (name argv options spec)

Define a function NAME that runs filter according to SPEC.

An intermediary function creating the corresponding command (without running it) is also defined. The name of this intermediary function is construced by prefixing COMMAND- to the provided NAME.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: define-query (name argv options spec)

Define a function NAME that runs query according to SPEC.
An intermediary function creating the corresponding command (without running it) is also defined. The name of this intermediary function is construced by prefixing COMMAND- to the provided NAME.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: define-test (name argv options spec)

Define a function NAME that runs test according to SPEC.
An intermediary function creating the corresponding command (without running it) is also defined. The name of this intermediary function is construced by prefixing COMMAND- to the provided NAME.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: define-utility (name argv options spec &key trim)

Define a function NAME that runs utility according to SPEC.
An intermediary function creating the corresponding command (without running it) is also defined. The name of this intermediary function is constructed by prefixing COMMAND- to the provided NAME.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: do-awk ((var (awkscript &key directory environment sepstring assignment) input &optional result) &body body)
Package

org.melusina.rashell.

Source

posix.lisp.

Macro: do-cat ((var (pathname-list &key directory environment) &optional result) &body body)
Package

org.melusina.rashell.

Source

posix.lisp.

Macro: do-filter ((var command input &optional result) &body body)

Run a query process running the given COMMAND and filter INPUT lines.

The VAR is successfully bound to each available line produced by COMMAND, after reading from INPUT stream and BODY is executed for each of these lines.

In the particular case where the COMMAND defines an OBJECT-OF-OUTPUT-LINE, the VAR is bound to the return value applied to the current line, instead of the actual line.

The returning form is RESULT.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: do-find ((var (predicate-expr pathname &key directory environment follow) &optional result) &body body)
Package

org.melusina.rashell.

Source

posix.lisp.

Macro: do-query ((var command &optional result) &body body)

Run a query process running the given COMMAND and process output lines.

The VAR is successfully bound to each available line produced by COMMAND, and BODY is executed for each of these lines. In the particular case where the COMMAND defines an OBJECT-OF-OUTPUT-LINE, the VAR is bound to the return value applied to the current line, instead of the actual line.

The returning form is RESULT.

Package

org.melusina.rashell.

Source

rashell.lisp.

Macro: do-sed ((var (sedscript &key directory environment echo) input &optional result) &body body)
Package

org.melusina.rashell.

Source

posix.lisp.

Macro: with-temporary-directory ((filespec) &body body)

Run BODY commands in a context where FILESPEC is bound to the path of a temporary directory.

Package

org.melusina.rashell.

Source

mktemp.lisp.

Macro: with-temporary-file ((filespec) &body body)

Run BODY commands in a context where FILESPEC is bound to the path of a temporary file.

Package

org.melusina.rashell.

Source

mktemp.lisp.


6.1.3 Ordinary functions

Function: arranged-conversation (clauses)

Prepare a command providing an arranged in advance conversation according to CLAUSES. The command evaluates each clause in CLAUSES in sequence. Each of these clauses can be one of the following forms:

(:SLEEP DURATION-IN-SECONDS)
Put process to sleep for DURATION-IN-SECONDS

(:WRITE-OUTPUT-LINE STRING)
Write STRING on process standard output. The output is not buffered.

(:WRITE-ERROR-LINE STRING)
Write STRING on process standard error. The output is not buffered.

(:READ-INPUT-LINE STRING)
Read a line from process standard input. If the input is different from string, then an explanatory error message is printed on standard error and the command terminates with exit code 1.

Bugs:
- The implementation does not validate the clauses.
- The implementation generates a shell script transfered
as an argument to /bin/sh -c which limits the number of clauses
that can constitute an arranged conversation.
- The implementation pass all strings to shell as-is in single quotes, which
is extremly brittle.

The intended use of ARRANGED-CONVERSATION is for testing and debugging.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: awk (input awkscript &key directory environment sepstring assignment)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: cat (pathname-list &key directory environment)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-awk (awkscript &key directory environment sepstring assignment)

Run awk(1) with the given AWKSCRIPT on INPUT.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-cat (pathname-list &key directory environment)

Run cat(1) on PATHNAME-LIST.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-cp (pathname-list destination &key directory environment follow force recursive)

Run cp(1) on PATHNAME-LIST and DESTINATION.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-df (path-or-paths &key directory environment)

Return the available free disk space on the devices for
the given PATHS, or for all devices if the empty list is given. The free disk space is computed with ‘df -k -P‘ as described in df(1).

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-du (pathname &key directory environment)

Query the consumed disk space for the file hierarchies
rooted at the given PATHNAME.

The output is an alist mapping PATHS to consumed disk space in kilobytes.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-find (predicate-expr pathname &key directory environment follow)

Prepare a find(1) command on PATHNAME with the given PREDICATE-EXPR.

The options are

FOLLOW
If set, symbolic links are followed.

DIRECTORY
A pathname to a working doirectory to use when running the command.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-ln (pathname destination &key directory environment force symbolic)

Run ln(1) on PATHNAME and DESINATION.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-make-temporary-directory (&key directory environment)

Run mktemp(1).

Package

org.melusina.rashell.

Source

mktemp.lisp.

Function: command-make-temporary-file (&key directory environment)

Run mktemp(1).

Package

org.melusina.rashell.

Source

mktemp.lisp.

Function: command-mkdir (pathname-list &key directory environment mode create-intermediate)

Run mkdir(1) on PATHNAME.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-mv (pathname-list destination &key directory environment force)

Run mv(1) on PATHNAME-LIST and DESINATION.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-p (object)

T if object is a command, NIL otherwise.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: command-rm (pathname-list &key directory environment force recursive)

Run rm(1) on PATHNAME-LIST.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: command-sed (sedscript &key directory environment echo)

Run sed(1) with the given SEDSCRIPT on INPUT.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: cp (pathname-list destination &key directory environment follow force recursive)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: df (path-or-paths &key directory environment)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: du (pathname &key directory environment)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: find* (predicate-expr pathname &key directory environment follow)
Package

org.melusina.rashell.

Source

posix.lisp.

Reader: free-disk-space-blocks (instance)
Writer: (setf free-disk-space-blocks) (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Target Slot

blocks.

Reader: free-disk-space-capacity (instance)
Writer: (setf free-disk-space-capacity) (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Target Slot

capacity.

Reader: free-disk-space-device (instance)
Writer: (setf free-disk-space-device) (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Target Slot

device.

Reader: free-disk-space-free (instance)
Writer: (setf free-disk-space-free) (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Target Slot

free.

Reader: free-disk-space-mounted-on (instance)
Writer: (setf free-disk-space-mounted-on) (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Target Slot

mounted-on.

Reader: free-disk-space-used (instance)
Writer: (setf free-disk-space-used) (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Target Slot

used.

Function: ln (pathname destination &key directory environment force symbolic)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: make-command (&rest initargs &key documentation object-of-output-line environment directory argv program &allow-other-keys)

Make a command.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: make-temporary-directory (&key directory environment)
Package

org.melusina.rashell.

Source

mktemp.lisp.

Function: make-temporary-file (&key directory environment)
Package

org.melusina.rashell.

Source

mktemp.lisp.

Function: mkdir (pathname-list &key directory environment mode create-intermediate)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: mv (pathname-list destination &key directory environment force)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: rm (pathname-list &key directory environment force recursive)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: run-filter (command input)

Run a query process running the given COMMAND on INPUT.

When INPUT is a stream, the returned value is a string holding the result of processing INPUT through the filter.

When INPUT is a pathname, the returned value is a string holding the result of processing the contents of the file designated by this pathname through the filter.

When INPUT is or a string, the returned value is a string holding the result of processing the contents of the string through the filter.

When INPUT is a string list the returned value is a string list.

When INPUT is an array, the returned value is an array of strings.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: run-query (command)

Run a query process running the given COMMAND and return the list of output lines.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: run-test (command)

Run COMMAND and return exit status as a generalised boolean.

When the external process running COMMAND exits with a return code of 0, the value T is returned, a code 1 is associated to NIL and other exit status are interpreted as errors. The accumulated standard output and standard error of the command are returned as second and third value.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: run-utility (command &key trim)

Run COMMAND as a utility.
Start an external process running COMMAND, without standard input. Return
the accumulated standard output and standard error as multiple values.

When TRIM is set to T, trailing whitespace is removed from the program standard output.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: sed (input sedscript &key directory environment echo)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: test (predicate-expr pathname &key follow directory environment)

Test the meta-data of file PATHNAME against PREDICATE-EXPRESSION. If the file does not exist, the test evaluates to NIL.

Package

org.melusina.rashell.

Source

posix.lisp.


6.1.4 Generic functions

Generic Function: close-command (command)

Close the COMMAND.

This closes all streams connected to the process running the COMMAND and also stops maintaining the status slot.
Returns COMMAND.
TODO:
- Clarify when to use this method – after or before the process exited?

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: close-command ((instance command))
Generic Function: command-error (command)

The standard error of the external process running the command or NIL.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: command-error ((instance command))
Generic Function: command-input (command)

The standard input of the external process running the command or NIL.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: command-input ((instance command))
Generic Function: command-output (command)

The standard output of the external process running the command or NIL.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: command-output ((instance command))
Generic Function: command-status (command)

Return a keyword denoting the status of the external process running
the command:

The status can be one of

:PENDING
When the command has not been started, so that no external process
actually runs it.

:RUNNING
When the command has been started and an external process currently runs it.

:STOPPED
When the operating system stopped the process and the process can be restarted.

:EXITED
When the process terminated after exiting. The exit code
of the process is returned as a second value.

:SIGNALED
When the process terminated after receiving a signal. The signal number that terminated the process is returned as a second value.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: command-status ((instance command))
Generic Function: kill-command (command signal)

Sends the given UNIX SIGNAL to the external process running COMMAND.
The SIGNAL can be either an integer or one of the keyword in ‘*SIGNAL-TABLE*’. When the PROCESS for command is in :PENDING state, no action is taken
and NIL is returned.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: kill-command ((instance command) signal)
Generic Function: run-command (command &key input if-input-does-not-exist output if-output-exists error if-error-exists status-hook)

Start a process executing the specified command in an external (UNIX) process.

Parameters INPUT, OUTPUT, and ERROR all behave similarly. They accept one of the following values:

NIL
When a null stream should be used,

T
The standard input (resp. output, error) from the process runinng the Lisp is inherited by the created external process.

A-STREAM
The A-STREAM is attached to the standard input (resp. output, error) of the created external process.

A-PATHNAME-DESIGNATOR
The corresponding file is open and attached to the standard input (resp. output, error) of the created external process.

:STREAM
A new stream opened for character input or output is created and attached to the created external process. This stream can
be manipulated by one of the COMMAND-*-STREAM functions.

:OUTPUT
This value is only valid for the :ERROR parameter and directs the standard error of the created process output to the same destination
as the standard output.

When :INPUT is the name of a file, the IF-INPUT-DOES-NOT-EXIST parameter defines the behaviour of the start command when it would attach standard input for the process to a non existing file. This parameter can take
the following values:

NIL (default)
The start command does not create an external process and returns NIL.

:ERROR
The start command does not create an external process and signals
an error condition.

:CREATE
The start command creates an empty file.

When :OUTPUT is the name of a file, the IF-OUTPUT-EXISTS parameter
defines the behaviour of the start command when it would attach standard output for the process to an already existing file. This parameter can take the following values:

NIL (default)
The start command does not create an external process and returns NIL.

:ERROR
The start command does not create an external process and signals
an error condition.

:SUPERSEDE
The content of the file will be superseded by the output of the external process.

:APPEND
The output of the external process will be appended to the content
of the file.

When :ERROR is the name of a file, the IF-ERROR-EXISTS parameter
defines the behaviour of the start command when it would attach standard error to an existing file. It takes the exact same values as IF-OUTPUT-EXISTS.

STATUS-HOOK is a function the system calls whenever the status of
the process changes. The function takes the command as an argument.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: run-command ((command command) &key input if-input-does-not-exist output if-output-exists error if-error-exists status-hook)
Generic Function: wait-command (command &optional check-for-stopped)

Wait for the external process running COMMAND to quit running. When CHECK-FOR-STOPPED is T, also returns when process is stopped. When the command is still :PENDING it returns immediately. Returns COMMAND.

Package

org.melusina.rashell.

Source

rashell.lisp.

Methods
Method: wait-command ((instance command) &optional check-for-stopped)

6.1.5 Standalone methods

Method: describe-object ((instance command) stream)
Source

rashell.lisp.

Method: print-object ((instance command) stream)
Source

rashell.lisp.


6.1.6 Conditions

Condition: command-error

This condition is signaled when an external process executing a command meets an error condition.

Package

org.melusina.rashell.

Source

rashell.lisp.

Direct superclasses

error.

Direct methods
Direct slots
Slot: command
Initargs

:command

Readers

command-error-command.

Writers

This slot is read-only.

Slot: status
Initargs

:status

Readers

command-error-status.

Writers

This slot is read-only.

Slot: code
Initargs

:code

Readers

command-error-code.

Writers

This slot is read-only.

Slot: accumulated-output
Initargs

:output

Readers

command-error-output.

Writers

This slot is read-only.

Slot: accumulated-error
Initargs

:error

Readers

command-error-error.

Writers

This slot is read-only.


6.1.7 Structures

Structure: free-disk-space
Package

org.melusina.rashell.

Source

posix.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: device
Type

string

Readers

free-disk-space-device.

Writers

(setf free-disk-space-device).

Slot: blocks
Type

number

Initform

0

Readers

free-disk-space-blocks.

Writers

(setf free-disk-space-blocks).

Slot: used
Type

number

Initform

0

Readers

free-disk-space-used.

Writers

(setf free-disk-space-used).

Slot: free
Type

number

Initform

0

Readers

free-disk-space-free.

Writers

(setf free-disk-space-free).

Slot: capacity
Type

float

Initform

0.0

Readers

free-disk-space-capacity.

Writers

(setf free-disk-space-capacity).

Slot: mounted-on
Type

string

Readers

free-disk-space-mounted-on.

Writers

(setf free-disk-space-mounted-on).


6.1.8 Classes

Class: command

The COMMAND structure captures the parameters and state of an external program. The current state of the external program can be examined with the methods

COMMAND-STATUS, COMMAND-INPUT, COMMAND-OUTPUT and COMMAND-ERROR.

Package

org.melusina.rashell.

Source

rashell.lisp.

Direct methods
Direct slots
Slot: program

A path to the program to run.

Initform

#p"/usr/bin/false"

Initargs

:program

Slot: argv

A sequence to be used as the argument vector for the program.

Initargs

:argv

Slot: directory

The working directory of the program to run.
If not provided, the current working directory is used.

Package

common-lisp.

Initargs

:directory

Slot: environment

Environment variable bindings for the program to run.
The ENVIRONMENT must be a sequence whose terms are:
- maybe the keywords :APPEND at the first position,
meaning the environment definitions should be appended to
the environment of the current process.
- maybe the keyword :SUPERSEDE at the first position, meaning
that the environment definitions describe the entire environment definitions available for the external process.
- either a string of the form "VARIABLE=VALUE";
- or a cons cell of the form (VARIABLE . VALUE).

When the ENVIRONMENT is NIL, then the environment of the calling process is inherited.

Initargs

:environment

Slot: object-of-output-line

When provided, a function to interpret output of the program as an object stream. The provided function should convert a trimmed output line to the desired value. The conversion is only used when operation the command as a query.

Initargs

:object-of-output-line

Slot: process

The external process running the program.

Slot: documentation

The documentation of the command instance.

Package

common-lisp.

Initargs

:documentation


6.2 Internals


6.2.1 Special variables

Special Variable: *consumed-disk-space-scanner*

The PPCRE scanner used to scan consumed space records.

Package

org.melusina.rashell.

Source

posix.lisp.

Special Variable: *find-predicate-grammar-table*

The grammar table for find(1) predicates.

Package

org.melusina.rashell.

Source

posix.lisp.

Special Variable: *free-disk-space-scanner*

The PPCRE scanner used to scan disk free space records.

Package

org.melusina.rashell.

Source

posix.lisp.

Special Variable: *signal-table*

The table mapping symbolic signal names to numeric signal names.

Package

org.melusina.rashell.

Source

rashell.lisp.


6.2.2 Macros

Macro: do-df ((var (path-or-paths &key directory environment) &optional result) &body body)
Package

org.melusina.rashell.

Source

posix.lisp.

Macro: do-du ((var (pathname &key directory environment) &optional result) &body body)
Package

org.melusina.rashell.

Source

posix.lisp.


6.2.3 Ordinary functions

Function: consumed-disk-space-of-string (text)

Read FREE-DISK-SPACE from the output of DF.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: copy-free-disk-space (instance)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: define-command/defun-argv (argv options)
Package

org.melusina.rashell.

Source

rashell.lisp.

Function: define-command/prepare-argv (argument spec)

Prepare argument vector interpreation fragment for ARGUMENT interpreted according to SPEC.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: define-command/to-string (argument)

Convert ARGUMENT to a string.

Package

org.melusina.rashell.

Source

rashell.lisp.

Function: do-filter/loop (command input process-one-line prepare-result)
Package

org.melusina.rashell.

Source

rashell.lisp.

Function: do-query/loop (command process-one-line prepare-result)
Package

org.melusina.rashell.

Source

rashell.lisp.

Function: ensure-list (anything)
Package

org.melusina.rashell.

Source

util.lisp.

Function: find-predicate-to-argv (predicate-form)

Convert PREDICATE-FORM to a sequence of arguments for the find(1) utility.

The PREDICATE-FORM expression is a list matching one of the following examples.

(:PRINT)
(:PRUNE)
(:HAS-KIND FILE-KIND)
(:HAS-SUFFIX SUFFIX)
(:IS-OWNED-BY-USER USER-NAME-OR-USER-ID)
(:IS-OWNED-BY-GROUP GROUP-NAME-OR-GROUP-ID)
(:IS-NEWER-THAN PATH)
(:HAS-EXACT-PERMISSION MODE)
(:HAS-AT-LEAST-PERMISSION MODE)
(:NAME GLOBBING-PATTERN)
(:PATH GLOBBING-PATTERN)
(:AND PREDICATE-FORM*)
(:OR PREDICATE-FORM*)
(:NOT PREDICATE-FORM)

Valid FILE-KIND paramters are

:BLOCK-SPECIAL
:CHARACTER-SPECIAL
:DIRECTORY
:SYMBOLIC-LINK
:FIFO
:REGULAR
:SOCKET

Package

org.melusina.rashell.

Source

posix.lisp.

Function: free-disk-space-of-string (text)

Read FREE-DISK-SPACE from the output of DF.

Package

org.melusina.rashell.

Source

posix.lisp.

Function: free-disk-space-p (object)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: make-free-disk-space (&key device blocks used free capacity mounted-on)
Package

org.melusina.rashell.

Source

posix.lisp.

Function: mktemp-template ()

A template for temporary files in our application.

Package

org.melusina.rashell.

Source

mktemp.lisp.

Function: string-match (pattern text)

Predicate recognising TEXT matching a globbing PATTERN.

Package

org.melusina.rashell.

Source

util.lisp.


6.2.4 Generic functions

Generic Reader: command-error-code (condition)
Package

org.melusina.rashell.

Methods
Reader Method: command-error-code ((condition command-error))
Source

rashell.lisp.

Target Slot

code.

Generic Reader: command-error-command (condition)
Package

org.melusina.rashell.

Methods
Reader Method: command-error-command ((condition command-error))
Source

rashell.lisp.

Target Slot

command.

Generic Reader: command-error-error (condition)
Package

org.melusina.rashell.

Methods
Reader Method: command-error-error ((condition command-error))
Source

rashell.lisp.

Target Slot

accumulated-error.

Generic Reader: command-error-output (condition)
Package

org.melusina.rashell.

Methods
Reader Method: command-error-output ((condition command-error))
Source

rashell.lisp.

Target Slot

accumulated-output.

Generic Reader: command-error-status (condition)
Package

org.melusina.rashell.

Methods
Reader Method: command-error-status ((condition command-error))
Source

rashell.lisp.

Target Slot

status.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   E   F   G   K   L   M   P   R   S   T   W  
Index Entry  Section

(
(setf free-disk-space-blocks): Public ordinary functions
(setf free-disk-space-capacity): Public ordinary functions
(setf free-disk-space-device): Public ordinary functions
(setf free-disk-space-free): Public ordinary functions
(setf free-disk-space-mounted-on): Public ordinary functions
(setf free-disk-space-used): Public ordinary functions

A
arranged-conversation: Public ordinary functions
awk: Public ordinary functions

C
cat: Public ordinary functions
close-command: Public generic functions
close-command: Public generic functions
command-awk: Public ordinary functions
command-cat: Public ordinary functions
command-cp: Public ordinary functions
command-df: Public ordinary functions
command-du: Public ordinary functions
command-error: Public generic functions
command-error: Public generic functions
command-error-code: Private generic functions
command-error-code: Private generic functions
command-error-command: Private generic functions
command-error-command: Private generic functions
command-error-error: Private generic functions
command-error-error: Private generic functions
command-error-output: Private generic functions
command-error-output: Private generic functions
command-error-status: Private generic functions
command-error-status: Private generic functions
command-find: Public ordinary functions
command-input: Public generic functions
command-input: Public generic functions
command-ln: Public ordinary functions
command-make-temporary-directory: Public ordinary functions
command-make-temporary-file: Public ordinary functions
command-mkdir: Public ordinary functions
command-mv: Public ordinary functions
command-output: Public generic functions
command-output: Public generic functions
command-p: Public ordinary functions
command-rm: Public ordinary functions
command-sed: Public ordinary functions
command-status: Public generic functions
command-status: Public generic functions
consumed-disk-space-of-string: Private ordinary functions
copy-free-disk-space: Private ordinary functions
cp: Public ordinary functions

D
define-command: Public macros
define-command/defun-argv: Private ordinary functions
define-command/prepare-argv: Private ordinary functions
define-command/to-string: Private ordinary functions
define-filter: Public macros
define-query: Public macros
define-test: Public macros
define-utility: Public macros
describe-object: Public standalone methods
df: Public ordinary functions
do-awk: Public macros
do-cat: Public macros
do-df: Private macros
do-du: Private macros
do-filter: Public macros
do-filter/loop: Private ordinary functions
do-find: Public macros
do-query: Public macros
do-query/loop: Private ordinary functions
do-sed: Public macros
du: Public ordinary functions

E
ensure-list: Private ordinary functions

F
find*: Public ordinary functions
find-predicate-to-argv: Private ordinary functions
free-disk-space-blocks: Public ordinary functions
free-disk-space-capacity: Public ordinary functions
free-disk-space-device: Public ordinary functions
free-disk-space-free: Public ordinary functions
free-disk-space-mounted-on: Public ordinary functions
free-disk-space-of-string: Private ordinary functions
free-disk-space-p: Private ordinary functions
free-disk-space-used: Public ordinary functions
Function, (setf free-disk-space-blocks): Public ordinary functions
Function, (setf free-disk-space-capacity): Public ordinary functions
Function, (setf free-disk-space-device): Public ordinary functions
Function, (setf free-disk-space-free): Public ordinary functions
Function, (setf free-disk-space-mounted-on): Public ordinary functions
Function, (setf free-disk-space-used): Public ordinary functions
Function, arranged-conversation: Public ordinary functions
Function, awk: Public ordinary functions
Function, cat: Public ordinary functions
Function, command-awk: Public ordinary functions
Function, command-cat: Public ordinary functions
Function, command-cp: Public ordinary functions
Function, command-df: Public ordinary functions
Function, command-du: Public ordinary functions
Function, command-find: Public ordinary functions
Function, command-ln: Public ordinary functions
Function, command-make-temporary-directory: Public ordinary functions
Function, command-make-temporary-file: Public ordinary functions
Function, command-mkdir: Public ordinary functions
Function, command-mv: Public ordinary functions
Function, command-p: Public ordinary functions
Function, command-rm: Public ordinary functions
Function, command-sed: Public ordinary functions
Function, consumed-disk-space-of-string: Private ordinary functions
Function, copy-free-disk-space: Private ordinary functions
Function, cp: Public ordinary functions
Function, define-command/defun-argv: Private ordinary functions
Function, define-command/prepare-argv: Private ordinary functions
Function, define-command/to-string: Private ordinary functions
Function, df: Public ordinary functions
Function, do-filter/loop: Private ordinary functions
Function, do-query/loop: Private ordinary functions
Function, du: Public ordinary functions
Function, ensure-list: Private ordinary functions
Function, find*: Public ordinary functions
Function, find-predicate-to-argv: Private ordinary functions
Function, free-disk-space-blocks: Public ordinary functions
Function, free-disk-space-capacity: Public ordinary functions
Function, free-disk-space-device: Public ordinary functions
Function, free-disk-space-free: Public ordinary functions
Function, free-disk-space-mounted-on: Public ordinary functions
Function, free-disk-space-of-string: Private ordinary functions
Function, free-disk-space-p: Private ordinary functions
Function, free-disk-space-used: Public ordinary functions
Function, ln: Public ordinary functions
Function, make-command: Public ordinary functions
Function, make-free-disk-space: Private ordinary functions
Function, make-temporary-directory: Public ordinary functions
Function, make-temporary-file: Public ordinary functions
Function, mkdir: Public ordinary functions
Function, mktemp-template: Private ordinary functions
Function, mv: Public ordinary functions
Function, rm: Public ordinary functions
Function, run-filter: Public ordinary functions
Function, run-query: Public ordinary functions
Function, run-test: Public ordinary functions
Function, run-utility: Public ordinary functions
Function, sed: Public ordinary functions
Function, string-match: Private ordinary functions
Function, test: Public ordinary functions

G
Generic Function, close-command: Public generic functions
Generic Function, command-error: Public generic functions
Generic Function, command-error-code: Private generic functions
Generic Function, command-error-command: Private generic functions
Generic Function, command-error-error: Private generic functions
Generic Function, command-error-output: Private generic functions
Generic Function, command-error-status: Private generic functions
Generic Function, command-input: Public generic functions
Generic Function, command-output: Public generic functions
Generic Function, command-status: Public generic functions
Generic Function, kill-command: Public generic functions
Generic Function, run-command: Public generic functions
Generic Function, wait-command: Public generic functions

K
kill-command: Public generic functions
kill-command: Public generic functions

L
ln: Public ordinary functions

M
Macro, define-command: Public macros
Macro, define-filter: Public macros
Macro, define-query: Public macros
Macro, define-test: Public macros
Macro, define-utility: Public macros
Macro, do-awk: Public macros
Macro, do-cat: Public macros
Macro, do-df: Private macros
Macro, do-du: Private macros
Macro, do-filter: Public macros
Macro, do-find: Public macros
Macro, do-query: Public macros
Macro, do-sed: Public macros
Macro, with-temporary-directory: Public macros
Macro, with-temporary-file: Public macros
make-command: Public ordinary functions
make-free-disk-space: Private ordinary functions
make-temporary-directory: Public ordinary functions
make-temporary-file: Public ordinary functions
Method, close-command: Public generic functions
Method, command-error: Public generic functions
Method, command-error-code: Private generic functions
Method, command-error-command: Private generic functions
Method, command-error-error: Private generic functions
Method, command-error-output: Private generic functions
Method, command-error-status: Private generic functions
Method, command-input: Public generic functions
Method, command-output: Public generic functions
Method, command-status: Public generic functions
Method, describe-object: Public standalone methods
Method, kill-command: Public generic functions
Method, print-object: Public standalone methods
Method, run-command: Public generic functions
Method, wait-command: Public generic functions
mkdir: Public ordinary functions
mktemp-template: Private ordinary functions
mv: Public ordinary functions

P
print-object: Public standalone methods

R
rm: Public ordinary functions
run-command: Public generic functions
run-command: Public generic functions
run-filter: Public ordinary functions
run-query: Public ordinary functions
run-test: Public ordinary functions
run-utility: Public ordinary functions

S
sed: Public ordinary functions
string-match: Private ordinary functions

T
test: Public ordinary functions

W
wait-command: Public generic functions
wait-command: Public generic functions
with-temporary-directory: Public macros
with-temporary-file: Public macros


A.3 Variables

Jump to:   *  
A   B   C   D   E   F   M   O   P   S   U  
Index Entry  Section

*
*consumed-disk-space-scanner*: Private special variables
*find-predicate-grammar-table*: Private special variables
*free-disk-space-scanner*: Private special variables
*mktemp-designator*: Public special variables
*mktemp-keep*: Public special variables
*query-output-line-number*: Public special variables
*signal-table*: Private special variables

A
accumulated-error: Public conditions
accumulated-output: Public conditions
argv: Public classes

B
blocks: Public structures

C
capacity: Public structures
code: Public conditions
command: Public conditions

D
device: Public structures
directory: Public classes
documentation: Public classes

E
environment: Public classes

F
free: Public structures

M
mounted-on: Public structures

O
object-of-output-line: Public classes

P
process: Public classes
program: Public classes

S
Slot, accumulated-error: Public conditions
Slot, accumulated-output: Public conditions
Slot, argv: Public classes
Slot, blocks: Public structures
Slot, capacity: Public structures
Slot, code: Public conditions
Slot, command: Public conditions
Slot, device: Public structures
Slot, directory: Public classes
Slot, documentation: Public classes
Slot, environment: Public classes
Slot, free: Public structures
Slot, mounted-on: Public structures
Slot, object-of-output-line: Public classes
Slot, process: Public classes
Slot, program: Public classes
Slot, status: Public conditions
Slot, used: Public structures
Special Variable, *consumed-disk-space-scanner*: Private special variables
Special Variable, *find-predicate-grammar-table*: Private special variables
Special Variable, *free-disk-space-scanner*: Private special variables
Special Variable, *mktemp-designator*: Public special variables
Special Variable, *mktemp-keep*: Public special variables
Special Variable, *query-output-line-number*: Public special variables
Special Variable, *signal-table*: Private special variables
status: Public conditions

U
used: Public structures


A.4 Data types

Jump to:   C   F   M   O   P   R   S   U  
Index Entry  Section

C
Class, command: Public classes
command: Public classes
command-error: Public conditions
Condition, command-error: Public conditions

F
File, mktemp.lisp: The org․melusina․rashell/src/mktemp․lisp file
File, org.melusina.rashell.asd: The org․melusina․rashell/org․melusina․rashell․asd file
File, package.lisp: The org․melusina․rashell/src/package․lisp file
File, posix.lisp: The org․melusina․rashell/src/posix․lisp file
File, rashell.lisp: The org․melusina․rashell/src/rashell․lisp file
File, util.lisp: The org․melusina․rashell/src/util․lisp file
free-disk-space: Public structures

M
mktemp.lisp: The org․melusina․rashell/src/mktemp․lisp file
Module, src: The org․melusina․rashell/src module

O
org.melusina.rashell: The org․melusina․rashell system
org.melusina.rashell: The org․melusina․rashell package
org.melusina.rashell.asd: The org․melusina․rashell/org․melusina․rashell․asd file

P
Package, org.melusina.rashell: The org․melusina․rashell package
package.lisp: The org․melusina․rashell/src/package․lisp file
posix.lisp: The org․melusina․rashell/src/posix․lisp file

R
rashell.lisp: The org․melusina․rashell/src/rashell․lisp file

S
src: The org․melusina․rashell/src module
Structure, free-disk-space: Public structures
System, org.melusina.rashell: The org․melusina․rashell system

U
util.lisp: The org․melusina․rashell/src/util․lisp file