]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Misc.pl
ws
[infobot.git] / src / Misc.pl
index 1965db20513723dc3d963982d9ea54325bd110d4..3163bb3201690e9970d289305af6e4929806326b 100644 (file)
@@ -96,7 +96,7 @@ sub timeget {
     } else {                   # the real thing.
        return [gettimeofday()];
     }
-}    
+}
 
 sub timedelta {
     my($start_time) = shift;
@@ -470,6 +470,22 @@ sub isStale {
     return 0;
 }
 
+sub isFileUpdated {
+    my ($file, $time) = @_;
+
+    if (! -f $file) {
+       return 1;
+    }
+
+    my $time_file = (stat $file)[9];
+
+    if ($time == $time_file) {
+       return 0;
+    } else {
+       return 1;
+    }
+}
+
 ##########
 ### make commands.
 ###