in reply to stat($f) vs -A $f
in thread More on Stat() vs -A
Could you post some sample code that shows the strange behavior?
Keep in mind that -A is the script startup time (which can be found in $^T) minus the file access time--in days. stat returns the absolute last access time in seconds since the epoch.
The following gets the last access time from a file by both methods. I tried it on three different OSs (OS X, WinXP, and RH 9), and the results are the same.
# do it with stat my $atime = (stat($ARGV[0]))[8]; print "stat says: ", scalar localtime $atime, "\n"; # do it with -A $atime = $^T - (-A $ARGV[0]) * 86400; print "-A says: ", scalar localtime $atime, "\n";
Brad
|
|---|