Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple file system database. Extracted from Bill St. Clair's Lisplog and ported to SBCL.
Common Lisp
branch: master

This branch is 6 commits ahead, 9 commits behind nikodemus:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
README
fsdb.asd

README

FSDB is a simple file-based "database". It supports reads, writes, and
directory listings of a file hierarchy, with thread-safe locking (when
run from a single Lisp process with multiple threads). Based on the
ideas of Patrick Chkoreff, which he has integrated into
http://loom.cc/

Currently works in Clozure Common Lisp (CCL) and SBCL.

Thanks to Nikodemus Siivola for the SBCL port.

There are quite a few exported symbols, but you can do a lot with just
the following:

make-fsdb (dir &key (external-format :default))
Function
-----
Make an FSDB instance based at the given DIR, which should be a path
to a filesystem directory. EXTERNAL-FORMAT will be used for all the
file opens.

db-get ((db fsdb) key &rest more-keys)
Method
-----
Read the file at the offset KEY/MORE-KEYS... from DB's DIR. Return a
string.

(setf db-get) (value (db fsdb) key &rest more-keys)
Method
-----
Write VALUE, which must be a string, to the file at the offset
KEY/MORE-KEYS... from DB's DIR.

db-contents ((db fsdb) &rest keys)
Method
-----
Return a list of the names of all the files and directories at the
offets KEYS... from DB's DIR. No paths will be in that list. Just
strings naming the individual files and sub-directories. No indication
is made of whether an element of the list is a file or a directory.

db-dir-p ((db fsdb) &rest keys)
Method
-----
Return true if there is a file or directory at path KEYS... from DB's
DIR and it is a directory.
Something went wrong with that request. Please try again.