These are tools for interacting with Unix systems, built on top of
uiop
.
- General
-
rsync
(source dest &key (delete nil) (verbose nil) (output nil) (error-output nil))
Synchronize a
SOURCE
directory to aDEST
using rsync.Parameters:
SOURCE
(string): The local directory or remote destination to synchronize.DEST
(string): The local directory or remote destination to synchronize.DELETE
(keyword): One of:before
,:during
,:after
, ornil
. Specifies whether rsync should delete files that don't exist inDEST
.VERBOSE
(bool): IfT
, add"--progress"
and"-v"
to the argument list. Otherwise,"-q"
(quiet-mode) is used.OUTPUT
(stream): The output stream to use.ERROR-OUTPUT
(stream): The stream to output errors to.
Returns: `nil` on successful synchronization (rsync exit code 0), or `nil` if an error occurs, with error details printed to `*error-output*`.
Example:
(rsync *doc-path* *ssh-host*) (rsync "my/docs/" "otherserver:/var/www")
Notes:
- Requires
rsync
to be installed and in the system’s path. - Assumes SSH access to the remote host (e.g., key-based authentication).
- Does not validate
SOURCE
orDEST
--- ensure they exist or are accessible.
- Path utilities
-
path-as-string
(path)
Givenpath
, which can be either astring
orpathname
, return it as astring
.path-as-pathname
(path)
Givenpath
, which can be either astring
orpathname
, return it as apathname
.extension-matches
(path ext)
Returnst
ifpath
has the extensionsext
. It is intended to be used in building predicates.any-extension-matches
(path extensions)
A predicate that returnsT
ifpath
has any of the extensions provided.filter-extensions
(extensions path-list)
Given a list of paths inpath-list
, remove with an extension contained inextensions
.select-extensions
(extensions path-list)
Given a list of paths inpath-list
, return a list of all paths with extensions contained inextensions
.