def getfilesize(path):
    size = -1
    try:
        size = os.path.getsize(path)
    except os.error as ex: