[Lxr-commits] CVS: lxr/lib/LXR/Files BK.pm,1.1.2.7,1.1.2.8
Brought to you by:
ajlittoz
From: Malcolm B. <mb...@us...> - 2005-02-14 22:40:06
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/lib/LXR/Files Modified Files: Tag: bk-dev-branch BK.pm Log Message: Implement getfilesize Index: BK.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/Attic/BK.pm,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- BK.pm 14 Feb 2005 00:55:23 -0000 1.1.2.7 +++ BK.pm 14 Feb 2005 22:39:57 -0000 1.1.2.8 @@ -109,6 +109,19 @@ return $info->{'filetime'}; } + +sub getfilesize { + my ($self, $pathname, $release) = @_; + + my $info = $self->getfileinfo($pathname, $release); + return undef if !defined($info); + + if(!defined($info->{'filesize'})) { + $info->{'filesize'} = length($self->getfile($pathname, $release)); + } + return $info->{'filesize'} +} + sub isdir { my ($self, $pathname, $release) = @_; $self->fill_cache($release); |