Re: File object question

2005-12-23 Thread Ben Hutchings
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

Re: File object question

2005-12-23 Thread S. D. Rose
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

Re: File object question

2005-12-22 Thread Kent Johnson
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

Re: File object question

2005-12-22 Thread Tim Williams (gmail)
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

Re: File object question

2005-12-22 Thread mrmakent
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

File object question

2005-12-22 Thread S. D. Rose
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