diff options
author | travis%sedsystems.ca <> | 2005-01-28 05:08:33 +0100 |
---|---|---|
committer | travis%sedsystems.ca <> | 2005-01-28 05:08:33 +0100 |
commit | f59ece67513bb56107a6a7d16cc4b1df9ab9aa9c (patch) | |
tree | 43175b0515d32618a7b795fb37fa440c34641abd /Bugzilla/Util.pm | |
parent | b61cb7207dea39ca70c2ffe3fbe3805506def34f (diff) | |
download | bugzilla-f59ece67513bb56107a6a7d16cc4b1df9ab9aa9c.tar.gz bugzilla-f59ece67513bb56107a6a7d16cc4b1df9ab9aa9c.tar.xz |
Bug 278791 : Move ModTime() to Bugzilla::Util
Patch by Max K-A <mkanat@kerio.com> r=vladd a=justdave
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r-- | Bugzilla/Util.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index b832d1698..e5207af78 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -33,7 +33,8 @@ use base qw(Exporter); 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; @@ -223,6 +224,14 @@ sub format_time_decimal { 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) = @_; @@ -272,6 +281,9 @@ Bugzilla::Util - Generic utility functions for bugzilla # 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 @@ -408,6 +420,13 @@ shown in different formats. 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 |