def newer(source, target):
 if (not os.path.exists(source)):
  raise DistutilsFileError(("file '%s' does not exist" % os.path.abspath(source)))
 if (not os.path.exists(target)):
  return 1
 from stat import ST_MTIME
 mtime1 = os.stat(source)[ST_MTIME]
 mtime2 = os.stat(target)[ST_MTIME]
 return (mtime1 > mtime2)

def newer ( source , target ) : if ( not os . path . exists ( source ) ) : raise DistutilsFileError ( ( "file '%s' does not exist" % os . path . abspath ( source ) ) ) if ( not os . path . exists ( target ) ) : return 1 from stat import ST_MTIME mtime1 = os . stat ( source ) [ ST_MTIME ] mtime2 = os . stat ( target ) [ ST_MTIME ] return ( mtime1 > mtime2 )
tells if the target is newer than the source .