Yes, len() will do what I want. I didn't realize it would work with binary, I thought it was good only for variables, lists, etc.
Thanks! -Dave "Kent Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > S. D. Rose 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 ...) > > Once you have read the data you can get the size of that: > d = file.read() > print len(d) > > Is that what you mean? Otherwise I don't know how you can get the size of a file without > asking the filesystem... > > Kent > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list