[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

dbm library

PWR

11/2/2006 3:48:00 PM

I am using Ruby 1.8.2 on Windows and am wanting to use the dbm library
but cannot seem to find it anywhere. Can anyone please tell me where I
can find this package?

4 Answers

Ara.T.Howard

11/2/2006 4:43:00 PM

0

snacktime

11/2/2006 6:17:00 PM

0

On 11/2/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> On Fri, 3 Nov 2006, PWR wrote:
>
> > I am using Ruby 1.8.2 on Windows and am wanting to use the dbm library
> > but cannot seem to find it anywhere. Can anyone please tell me where I
> > can find this package?
>
> it comes with ruby.
>
> harp:~ > ruby -r dbm -e' p DBM '
> DBM

With ruby 1.8.5, there is no DBM on windows, it's SDBM or GDBM.

PWR

11/3/2006 1:25:00 PM

0


snacktime wrote:
> On 11/2/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> > On Fri, 3 Nov 2006, PWR wrote:
> >
> > > I am using Ruby 1.8.2 on Windows and am wanting to use the dbm library
> > > but cannot seem to find it anywhere. Can anyone please tell me where I
> > > can find this package?
> >
> > it comes with ruby.
> >
> > harp:~ > ruby -r dbm -e' p DBM '
> > DBM
>
> With ruby 1.8.5, there is no DBM on windows, it's SDBM or GDBM.

Thanks, that's solved it. I am now using SDBM.

Bill Kelly

11/3/2006 2:10:00 PM

0

From: "PWR" <pw_richards@fastmail.fm>
>
> snacktime wrote:
>> On 11/2/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
>> > On Fri, 3 Nov 2006, PWR wrote:
>> >
>> > > I am using Ruby 1.8.2 on Windows and am wanting to use the dbm library
>> > > but cannot seem to find it anywhere. Can anyone please tell me where I
>> > > can find this package?
>> >
>> > it comes with ruby.
>> >
>> > harp:~ > ruby -r dbm -e' p DBM '
>> > DBM
>>
>> With ruby 1.8.5, there is no DBM on windows, it's SDBM or GDBM.
>
> 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