X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXDupe.pm;h=9198aee6c050939b2d5852f81d089683938835da;hb=770092d94f96b6d22a38fb33e0056b4779a8a1ab;hp=851e3a6953eef03450020f399a9efa2b4b17f42f;hpb=b9dffeff7239952814342dad19db3a51def6fab7;p=spider.git diff --git a/perl/DXDupe.pm b/perl/DXDupe.pm index 851e3a69..9198aee6 100644 --- a/perl/DXDupe.pm +++ b/perl/DXDupe.pm @@ -21,14 +21,9 @@ $fn = "$main::data/dupefile"; sub init { + unlink $fn; $dbm = tie (%d, 'DB_File', $fn); - unless ($dbm) { - eval { untie %d }; - dbg("Dupefile $fn corrupted, removing..."); - unlink $fn; - $dbm = tie (%d, 'DB_File', $fn) or confess "can't open dupe file: $fn ($!)"; - confess "cannot open $fn $!" unless $dbm; - } + confess "cannot open $fn $!" unless $dbm; } sub finish @@ -36,6 +31,12 @@ sub finish undef $dbm; untie %d; undef %d; + unlink $fn; +} + +sub active +{ + return $dbm; } sub check