On 22/12/05, S. D. Rose <[EMAIL PROTECTED]> wrote:
Hello all.
  If I read a binary file:

file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get the
object, d/l from website another...
file.read()

is there anyway I can determine the 'size' of the object file? (Without
going to the filesystem and reading the filesize from the directory ...

On my w2k box I use this for binary files

file = open('c:\\logo.gif', 'r+b'') # Read from FS as one way to get the
object, d/l from website another...
file_read = file.read()
len(file_read)

Note:  you must specify the binary option for binary files or you may not get the whole file.

HTH :)

--

Tim Williams
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to