From: "PWR said:
Thanks, that's solved it. I am now using SDBM.
Warning, unless something's changed since I last tried SDBM
on Windows a few years ago... It has some severe limitations.
(It wasn't a Ruby problem, Perl uses the same SDBM library and
exhibits the same issues.)
For ex... This test program tries to write a million key/values
to an SDBM store, where the key length is 8 bytes, and the
value ranges from 1..512 bytes:
require 'sdbm'
k = 12345678
SDBM.open("test.dbm") do |dbm|
1000.times {|iter|
1000.times {
dbm[k.to_s] = "v" * (rand(511) + 1)
k += 1
}
print "#{iter} "
}
end
On my system (win xp pro, NTFS) it only makes it to around
40,000 to 50,000 keys before blowing up with:
dbmtest.rb:9:in `[]=': sdbm_store failed (SDBMError)
And the .pag file size has bloated up to 1.7 to 2.1 gigs at
the point it dies.
Anyway, just FYI... if you program needs to store a lot of
key/values, SDBM may not be able to handle it...
Regards,
Bill