css_class_quote
lsearch max min
trim diff_strings
- format_time format_time_decimal);
+ format_time format_time_decimal
+ file_mod_time);
use Bugzilla::Config;
use Bugzilla::Error;
return $newtime;
}
+sub file_mod_time ($) {
+ my ($filename) = (@_);
+ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+ $atime,$mtime,$ctime,$blksize,$blocks)
+ = stat($filename);
+ return $mtime;
+}
+
sub ValidateDate {
my ($date, $format) = @_;
# Functions for formatting time
format_time($time);
+ # Functions for dealing with files
+ $time = file_mod_time($filename);
+
=head1 DESCRIPTION
This package contains various utility functions which do not belong anywhere
Returns a number with 2 digit precision, unless the last digit is a 0. Then it
returns only 1 digit precision.
+=head2 Files
+
+=over 4
+
+=item C<file_mod_time($filename)>
+
+Takes a filename and returns the modification time. It returns it in the format of the "mtime" parameter of the perl "stat" function.
=back
}
-
-
-# Returns the modification time of a file.
-
-sub ModTime {
- my ($filename) = (@_);
- my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks)
- = stat($filename);
- return $mtime;
-}
-
$::VersionTableLoaded = 0;
sub GetVersionTable {
return if $::VersionTableLoaded;
- my $mtime = ModTime("$datadir/versioncache");
+ my $mtime = file_mod_time("$datadir/versioncache");
if (!defined $mtime || $mtime eq "" || !-r "$datadir/versioncache") {
$mtime = 0;
}
use File::Temp;
use Bugzilla;
use Bugzilla::Config qw(:DEFAULT $webdotdir);
+use Bugzilla::Util;
require "CGI.pl";
# symlinks), this can't escape to delete anything it shouldn't
# (unless someone moves the location of $webdotdir, of course)
trick_taint($f);
- if (ModTime($f) < $since) {
+ if (file_mod_time($f) < $since) {
unlink $f;
}
}