S. D. Rose <[EMAIL PROTECTED]> wrote:
> "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 a
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:
> >
> > fil
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 rea
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 theobject, d/l from website another...file.read()is there anyway I can determine the 'size' of the object file? (Without
going to the filesystem
See http://www.python.org/doc/2.4.2/lib/os-file-dir.html for the 'stat'
function
import os
os.stat(path).st_size
This will return the size in bytes of the file designated by 'path'.
--
http://mail.python.org/mailman/listinfo/python-list
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