File object question
S. D. Rose
s_david_rose at hotmail.com
Fri Dec 23 09:08:29 EST 2005
More information about the Python-list mailing list
Fri Dec 23 09:08:29 EST 2005
- Previous message (by thread): File object question
- Next message (by thread): File object question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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" <kent at kentsjohnson.com> wrote in message news:43ab3f2c_1 at newspeer2.tds.net... > 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 >
- Previous message (by thread): File object question
- Next message (by thread): File object question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list