ruby-hyperestraier

Sziasztok, ezt nem ertem:


#!/usr/local/bin/ruby
require "estraier"
require "fileutils"
include Estraier

FileUtils.touch('valami')

db=Database.new
unless db.open('/home/phaul/.ruby-hype', Database::DBWRITER | Database::DBCREAT)
   puts ("Can't open database: " + db.err_msg(db.error))
   exit
end
puts 'opened'
unless db.close
   puts ("Can't close database: " + db.err_msg(db.error))
end

A problema az, hogy ha van valami nevu fajl akkor meg lehet nyitni az adatbazist, ha nincs akkor nem. (Ha a FileUtils.touch('valami') sort kiveszem akkor is meg lehet.) Nem nagyon latom az osszefuggest. Talan van valami IO singleton melyen amiben valami hiba jelzo bit bebillen a touch-nal?

Egyebkent
ruby-1.8.5p7 object oriented script language with threads
ruby-hyperestraier-1.0.0p3 Ruby interface to hyperestraier

Hozzászólások

Nincs valami opciója még a touch-nak? Minek a touch, ha anélkül is megy a dolog?

A touch opcioji: noop, verbose.
Lecsereltem a touchot erre:


File.new('valami', File::CREAT)

Igy meg mukodik. Fura. Igy nem hagy el egy nyitott fajl deszkriptort?
(Amugy ha utanna meghivom ra a close-t megint nem mukodik, csak akkor az adatbazist
lezarni nem lehet.)
==
`Have some wine,' the March Hare said in an encouraging tone.
Alice looked all round the table, but there was nothing on it but tea.