Dismas has asked for the wisdom of the Perl Monks concerning the following question:

Me again, O wise ones...
$diff = time; ... $secs = (stat( $file ))[8]; $access = int(($diff - $secs)/86400) + 0.5);

...works most of the time, but occasionally gives what can only be described as bizarre values for last access. For example, I have a file that was edited (i.e.:accessed) on 02 August, and the snip above gives a "last access time" of more than three years ago for that file--1166 days.
A coworker's trying to help unravel this, and thinks it might be due to, or related to, a known SCO problem with one of the *time clocks.
Any light shed would be appreciated!

Thanks!
Deane

Replies are listed 'Best First'.
Re: SCO/UNIX stat malfunction?
by dave_the_m (Monsignor) on Aug 03, 2004 at 15:11 UTC
    Well, see what the output of ls -lu gives you. If ls thinks it's got a funny access time too, then there's not a lot Perl can do about it.

    (And I avoided making any snide comments about SCO...)

    Dave.