Well, I was incorrect when I said they were stored in delete.db. The actual file name they are stored in is linksdel.db.
In db.pl, sub delete-records, I changed this code:
Code:
# Search the database for a record to delete.
open (DB, "<$db_file_name") or &cgierr("error in delete_records. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
(/^#/) and ($output .= $_ and next LINE);
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
$delete_list{$data[$db_key_pos]} ? # if this id is one we want to delete
($delete_list{$data[$db_key_pos]} = 0) : # then mark it deleted and don't print it to the new database.
($output .= "$_\n"); # otherwise print it.
}
close DB;
To read:
Code:
# Search the database for a record to delete.
open (DB, "<$db_file_name") or &cgierr("error in delete_records. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB> ) {
(/^#/) and ($output .= $_ and next LINE);
(/^\s*$/) and next LINE;
chomp;
@data = &split_decode($_);
# If this is the ID of a record to delete, mark it as deleted and store
# it in the linksdel.db database for possible future reactivation. Do not
# print it to the links.db database. If it is not the ID of a record to
# delete, then include the record in $output for writing to links.db.
if ($delete_list{$data[$db_key_pos]}) {
$delete_list{$data[$db_key_pos]} = 0;
open (DELDB, ">>$db_script_path/data/linksdel.db")
or &cgierr("Unable to open $db_script_path/data/linksdel.db.\nReason: $!");
print DELDB "$_\n";
close DELDB;
}
else { $output .= "$_\n"; }
# $delete_list{$data[$db_key_pos]} ? # if this id is one we want to delete
# ($delete_list{$data[$db_key_pos]} = 0) : # then mark it deleted and don't print it to the new database.
# ($output .= "$_\n"); # otherwise print it.
}
close DB;
You could do something similar for the sub validate_records routine in db.pl.
I hope this helps.
[This message has been edited by Bobsie (edited August 08, 1999).]