summaryrefslogtreecommitdiff
path: root/fml/lib/Mail/ThreadTrack
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-11-03 07:42:35 +0000
committerfukachan <fukachan>2001-11-03 07:42:35 +0000
commite4d3fab191a65f1d99b27d29e6361d96b53a4be2 (patch)
tree64474e55573d9dd8bc71b3c1e9e7248837b983ed /fml/lib/Mail/ThreadTrack
parent2f4517bb03f48575d4e24631a0c4f5b0049b1382 (diff)
downloadfml8-e4d3fab191a65f1d99b27d29e6361d96b53a4be2.tar.gz
fml8-e4d3fab191a65f1d99b27d29e6361d96b53a4be2.tar.bz2
fml8-e4d3fab191a65f1d99b27d29e6361d96b53a4be2.zip
make index database in db_base_dir not db_dir
Diffstat (limited to 'fml/lib/Mail/ThreadTrack')
-rw-r--r--fml/lib/Mail/ThreadTrack/DB.pm31
1 files changed, 23 insertions, 8 deletions
diff --git a/fml/lib/Mail/ThreadTrack/DB.pm b/fml/lib/Mail/ThreadTrack/DB.pm
index 4a90c3a0..baa00366 100644
--- a/fml/lib/Mail/ThreadTrack/DB.pm
+++ b/fml/lib/Mail/ThreadTrack/DB.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: DB.pm,v 1.2 2001/11/03 00:18:01 fukachan Exp $
+# $FML: DB.pm,v 1.3 2001/11/03 01:22:14 fukachan Exp $
#
package Mail::ThreadTrack::DB;
@@ -51,18 +51,19 @@ my @kind_of_databases = qw(thread_id
status
sender
articles
- message_id
- index);
-
+ message_id);
+
+# Descriptions:
+# Arguments: $self $args
+# Side Effects:
+# Return Value: none
sub db_open
{
my ($self) = @_;
- my $db_type = $self->{ config }->{ thread_db_type } || 'AnyDBM_File';
+ my $db_type = $self->{ config }->{ db_type } || 'AnyDBM_File';
my $db_dir = $self->{ _db_dir };
- my $index_file = $self->{ _index_db };
-
eval qq{ use $db_type; use Fcntl;};
unless ($@) {
for my $db (@kind_of_databases) {
@@ -75,6 +76,14 @@ sub db_open
eval $str;
croak($@) if $@;
}
+
+ my %index = ();
+ my $index_file = $self->{ _index_db };
+ eval q{
+ tie %index, $db_type, $index_file, O_RDWR|O_CREAT, 0644;
+ $self->{ _hash_table }->{ _index } = \%index;
+ };
+ croak($@) if $@;
}
else {
croak("cannot use $db_type");
@@ -84,6 +93,10 @@ sub db_open
}
+# Descriptions:
+# Arguments: $self $args
+# Side Effects:
+# Return Value: none
sub db_close
{
my ($self) = @_;
@@ -96,8 +109,10 @@ sub db_close
eval $str;
croak($@) if $@;
}
-}
+ my $index = $self->{ _hash_table }->{ _index };
+ untie %$index;
+}
=head1 AUTHOR