+25Oct02=======================================================================
+1. remove the dupefile automatically if it becomes corrupted
21Oct02=======================================================================
1. Fix msg aging.
2. make the default pinginterval and obscount variable (set/var
sub init
{
$dbm = tie (%d, 'DB_File', $fn) or confess "can't open dupe 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;
+ }
}
sub finish
confess "need a filename in User" if !$fn;
$fn .= ".v2";
if ($mode) {
- $dbm = tie (%u, 'DB_File', $fn, O_CREAT|O_RDWR, 0666, $DB_BTREE) or confess "can't open user file: $fn ($!)";
+ $dbm = tie (%u, 'DB_File', $fn, O_CREAT|O_RDWR, 0666, $DB_BTREE) or confess "can't open user file: $fn ($!) [rebuild it from user_asc?]";
} else {
- $dbm = tie (%u, 'DB_File', $fn, O_RDONLY, 0666, $DB_BTREE) or confess "can't open user file: $fn ($!)";
+ $dbm = tie (%u, 'DB_File', $fn, O_RDONLY, 0666, $DB_BTREE) or confess "can't open user file: $fn ($!) [rebuild it from user_asc?]";
}
$filename = $fn;