def getsize(p): """ Return the size of a file, reported by os.stat(). """ st= os.stat(p) return st[stat.ST_SIZE]