# \[ANN\] fsdb

**URL:** <https://rubytalk.org/t/ann-fsdb/4983>\
**Category:** ruby-talk\
**Created:** [3 March 2003 02:35 UTC](https://rubytalk.org/t/ann-fsdb/4983 "2003-03-03T02:35:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [3 March 2003 02:35 UTC](https://rubytalk.org/t/ann-fsdb/4983/1 "2003-03-03T02:35:18Z")

</div>

FSDB is a file system data base. FSDB provides a thread-safe,  
process-safe Database class which uses the native file system as its  
back end and allows multiple file formats and serialization methods.  
Users access objects in terms of their paths relative to the base  
directory of the database. It’s very light weight (the state of a  
Database is essentially just a path string, and code size is very small,  
under 1K lines, all ruby).

Here’s a simple example:

require ‘fsdb’

db = FSDB::Database.new(’/tmp/my-data’)

db[‘recent-movies/myself’] = [“LOTR II”, “Austin Powers”]  
puts db[‘recent-movies/myself’][0] # ==\> “LOTR II”

db.edit ‘recent-movies/myself’ do |list|  
list \<\< "A la recherche du temps perdu"  
end

It’s on RAA, or at:

[http://redshift.sourceforge.net/fsdb/](http://redshift.sourceforge.net/fsdb/)

Browse the docs at:

[http://redshift.sourceforge.net/fsdb/doc/index.html](http://redshift.sourceforge.net/fsdb/doc/index.html)

The test/test-fsdb.rb file has some basic examples. Look at  
test/test-concurrency.rb if you’re interested in how I tested thread and  
process safety.
