On Thu, 2 Feb 2006, James Edward Gray II wrote:

> On Feb 1, 2006, at 9:31 AM, ara.t.howard / noaa.gov wrote:
>
>> why not pstore - it's done all that already and is built-in?
>
> PStore is just a wrapper on top of Marshal for transactional file storage. 
> If you need transactions, it's great.  Otherwise, you might as well just use 
> Marshal.

it's not quite only that.  it also

   - does some simple checks when creating the file (readability, etc)
   - allows db usage to be multi-processed
   - supports deletion
   - rolls backs writes on exceptions / commits using ensure to avoid corrupt
     data file
   - handles read vs write actions using shared/excl locks to boost concurrency
   - uses  md5 check to avoid un-needed writes
   - opens in correct modes for all platforms

with no offense meant towards memoize authors - at least of few of the bugs
posted regarding that package would have been addressed by using a built-in
lib rather that rolling one's own.  and, of course, that's the big thing - why
not use something already written and tested from the core instead of
re-inventing the wheel?

in any case, i think the pstore lib, simple as it is, is a very underated
library since it provides simple transactional and concurrent persistence to
ruby apps in such an incredibly simply way.  now if we could just get joels
fsdb in the core!  ;-)

kind regards.

-a

-- 
happiness is not something ready-made.  it comes from your own actions.
- h.h. the 14th dali lama