Ignore atime for directories

This commit is contained in:
hjp 2002-03-18 20:33:46 +00:00
parent 6f278ae0cb
commit a139e5334b
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
#!@@@perl@@@ -w #!@@@perl@@@ -w
# #
# $Id: agestat.pl,v 1.4 2001-01-19 19:06:01 hjp Exp $ # $Id: agestat.pl,v 1.5 2002-03-18 20:33:46 hjp Exp $
# #
use strict; use strict;
@ -33,8 +33,8 @@ sub wanted {
my $age = $now - ( my $age = $now - (
$opts{atime} ? $st->atime : $opts{atime} ? $st->atime :
$opts{mtime} ? $st->mtime : $opts{mtime} ? $st->mtime :
($st->atime > $st->mtime ? $st->atime (! -d && $st->atime > $st->mtime ? $st->atime
: $st->mtime )); : $st->mtime ));
#print $File::Find::name, ": $age sec, ", $st->size, " bytes, ", $st->nlink, " links\n"; #print $File::Find::name, ": $age sec, ", $st->size, " bytes, ", $st->nlink, " links\n";
my $log2age = log($age >= 1 ? $age : 1) / $log_2; my $log2age = log($age >= 1 ? $age : 1) / $log_2;
$hist[$log2age] += $st->size / $st->nlink; $hist[$log2age] += $st->size / $st->nlink;
@ -80,7 +80,10 @@ for (my $i = 0; $i <= $#hist; $i++) {
} }
# $Log: agestat.pl,v $ # $Log: agestat.pl,v $
# Revision 1.4 2001-01-19 19:06:01 hjp # Revision 1.5 2002-03-18 20:33:46 hjp
# Ignore atime for directories
#
# Revision 1.4 2001/01/19 19:06:01 hjp
# Removed superfluous "total" line. # Removed superfluous "total" line.
# Fixed usage message. # Fixed usage message.
# #