def getfilemtime(path):
    mtime = -1
    try:
        mtime = os.path.getmtime(path)
    except os.error as ex: