} else { # the real thing.
return [gettimeofday()];
}
-}
+}
sub timedelta {
my($start_time) = shift;
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.
###
$i += $cmdstats{$type};
- my %hash = (
- nick => $type,
- type => "cmdstats",
- counter => $i
- );
- $hash{time} = time() if ($z);
- if (0) {
- &sqlReplace("stats", %hash);
- } else {
- &sqlReplace("stats", {
- nick => $type,
- type => "cmdstats",
- -counter => "counter+1",
- } );
- }
+ &sqlReplace("stats", {
+ nick => $type,
+ type => "cmdstats",
+ 'time' => time(),
+ counter => $i,
+ } );
}
}