33.7. Directory Access

This module provides some directory access from lisp, in package LDAP.

When this module is present, *FEATURES* contains the symbol :DIRKEY.

3 types of directory keys may exist, depending on the compilation environment.

valid directory key types

Win32 registry access
gnome-config access
LDAP interface via OpenLDAP or compatible

The following functions and macros are exported (please note that these features are experimental and the API may be modified in the future).

Open the directory key under dkey, which should be either an open directory key or a valid directory key type. The meaning of the :DIRECTION and :IF-DOES-NOT-EXIST keyword arguments is the same as for OPEN.
Close the directory key. The preferred way is to use the LDAP:WITH-DIR-KEY-OPEN macro.
(LDAP:WITH-DIR-KEY-OPEN (variable dkey pathname &REST {option}*) &BODY body)
Open the directory key (by calling LDAP:DIR-KEY-OPEN on dkey, pathname and options), bind it to variable, execute body, then close it with LDAP:DIR-KEY-CLOSE.
Return the directory key type of the directory key
Return the path of this directory key, which is the pathname argument of LDAP:DIR-KEY-OPEN if dkey was a directory key type or the concatenation of the pathname argument and the ldap:dir-key-path of dkey.
One of :INPUT, :OUTPUT and :IO, indicating the permitted operation on this key and its derivatives.
Check whether the key has been closed. It is not an error to close a closed key.
Delete the specified subkey or attribute.
Return the list of the subkeys or attributes.
(LDAP:DIR-KEY-VALUE dkey attribute &OPTIONAL default)
Return the value of the specified attribute, similar to GETHASH and SETFable just like GETHASH.
Return some information about the directory key. This is highly platform-dependent and will probably be removed or replaced or modified in the future.
(LDAP:WITH-DIR-KEY-SEARCH (key-iter atribute-iter dkey pathname &KEY :scope) &BODY body)

This is the main way to iterate over the subtree under the key dkey+pathname.

key-iter is a non-NIL symbol and is bound via MACROLET to a macro, each call of which returns the next subkey.

atribute-iter is a symbol and is bound, when non-NIL, to a macro, each call of which returns two values - the next attribute and its value.

The :scope keyword argument specifies the scope of the search and can be

iterate over the key itself
iterate over the children of the key
iterate over the subtree

LDAP:WITH-DIR-KEY-SEARCH is used to implement LDAP:DIR-KEY-VALUES, LDAP:DIR-KEY-CHILDREN and LDAP:DIR-KEY-DUMP-TREE in modules/dirkey/dirkey1.lisp.

These notes document CLISP version 2.49Last modified: 2010-07-07