[Python-Dev] Suggestion: stopping to trust os mtimes

Greg Stein gstein@lyra.org
Sat, 3 Jun 2000 12:41:19 -0700 (PDT)


On Sat, 3 Jun 2000, Skip Montanaro wrote:
>     Greg> I recall a case back '95 when I was editing a .py over an NFS
>     Greg> mount and running the code on the target machine. The clocks on
>     Greg> the two boxes were off by about three seconds. I was going thru
>     Greg> the edit/run/edit/run cycle so quickly, that at one point, I saved
>     Greg> a .py file that was older than the associated .pyc file.
> 
> A help I think would be to compare the mtimes of the .py and .pyc files with 
> the current system clock and squawk if either appears to have been created
> in the future.  I believe this is what GNU make does.

Sure, but to the target machine, the .pyc was fine and the .py was in the
past. :-)

Of course, the proper solution is to introduce compile/link stages into
Python so that we don't get bitten by 3-second clock differences.

:-)

-- 
Greg Stein, http://www.lyra.org/