diff options
| author | fukachan <fukachan> | 2002-02-04 00:07:17 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-02-04 00:07:17 +0000 |
| commit | 2605966a0f64776c271efe7619d08e6e79b0dae7 (patch) | |
| tree | cd656320262d5f31fa00510963cf6662ceecb8e5 | |
| parent | 11012650e4f37eb9911c05c13537f8aeb9223a29 (diff) | |
| download | fml8-2605966a0f64776c271efe7619d08e6e79b0dae7.tar.gz fml8-2605966a0f64776c271efe7619d08e6e79b0dae7.tar.bz2 fml8-2605966a0f64776c271efe7619d08e6e79b0dae7.zip | |
implement db_last_modified()
It return the last modified time of "date" DB in dateabase as unix time.
| -rw-r--r-- | fml/lib/Mail/ThreadTrack/DB.pm | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/fml/lib/Mail/ThreadTrack/DB.pm b/fml/lib/Mail/ThreadTrack/DB.pm index 6189af3c..08c9fbe5 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.21 2002/02/01 12:04:03 fukachan Exp $ +# $FML: DB.pm,v 1.22 2002/02/02 07:55:46 fukachan Exp $ # package Mail::ThreadTrack::DB; @@ -257,6 +257,34 @@ sub db_hash } +=head2 db_last_modified() + +return the last modified time of our dateabase as unix time. +This time is the latest modified time among all database files. + +=cut + + +# Descriptions: return the last modified time (unix time) of database +# Arguments: OBJ($self) STR($db_type) +# Side Effects: none +# Return Value: STR or UNDEF +sub db_last_modified +{ + my ($self, $db_type) = @_; + my $db_dir = $self->{ _db_dir }; + my $last_modified = 0; + + use File::Spec; + my $file = File::Spec->catfile($db_dir, "date.db"); + if (-f $file) { + $last_modified = (stat($file))[8]; + } + + return $last_modified; +} + + =head1 AUTHOR Ken'ichi Fukamachi |
