X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FUSDB.pm;fp=perl%2FUSDB.pm;h=89cd9fe5661c9e1988e6e4a2954f58fdf9a2d85f;hb=8178d787d7cc8040fa8958197582bba5c80e6f59;hp=ed519b4b86aa5e2cc03d6222ffcb824586774fbe;hpb=d0e554d25adfe94a2d5a1c3f57b48bfab1a9f4a2;p=spider.git diff --git a/perl/USDB.pm b/perl/USDB.pm index ed519b4b..89cd9fe5 100644 --- a/perl/USDB.pm +++ b/perl/USDB.pm @@ -28,7 +28,12 @@ $dbfn = "$main::data/usdb.v1"; sub init { end(); - tie %db, 'DB_File', $dbfn and $present = 1; + if (tie %db, 'DB_File', $dbfn, O_RDONLY, 0664, $DB_BTREE) { + $present = 1; + dbg("US Database loaded"); + } else { + dbg("US Database not loaded"); + } } sub end @@ -122,6 +127,7 @@ sub load untie %dbn; rename "$dbfn.new", $dbfn; + return (); } 1;