add comment and improve logging of figuring out event starttime from youngest file

This commit is contained in:
Isaac Connor 2020-07-28 10:35:28 -04:00
parent 767f5ebb03
commit 5bea68c93d
1 changed files with 3 additions and 3 deletions

View File

@ -1059,6 +1059,7 @@ sub delete_empty_directories {
}
} # end sub delete_empty_directories
# The idea is that the youngest file in the event directory gives us the event starttime
sub time_of_youngest_file {
my $dir = shift;
@ -1067,14 +1068,13 @@ sub time_of_youngest_file {
return;
}
my $youngest = (stat($dir))[9];
Debug("stat of $dir is $youngest");
Debug("stat of dir $dir is $youngest");
foreach my $file ( readdir( DIR ) ) {
next if $file =~ /^\./;
$_ = (stat($dir))[9];
$youngest = $_ if $_ and ( $_ < $youngest );
#Debug("stat of $dir is $_ < $youngest");
Debug("Found younger file $file at $youngest");
}
Debug("stat of $dir is $youngest");
return $youngest;
} # end sub time_of_youngest_file