def GetFileLength(fh):
 pos = fh.tell()
 fh.seek(0, 2)
 length = fh.tell()
 fh.seek(pos, 0)
 return length

def GetFileLength ( fh ) : pos = fh . tell ( ) fh . seek ( 0 , 2 ) length = fh . tell ( ) fh . seek ( pos , 0 ) return length
returns the length of the file represented by fh .