Re: File object question



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
.



Relevant Pages

  • File object question
    ... is there anyway I can determine the 'size' of the object file? ... going to the filesystem and reading the filesize from the directory ...) ...
    (comp.lang.python)
  • Re: Furthering my education in OOP - where/how can one learn professional skills?
    ... After reading many of the responses, it seemed beneficial that I be ... my hobby - website development. ... I find myself in possession of a feature-rich ... with formatting options. ...
    (comp.lang.php)
  • Re: Pair jailed for race-hate crimes
    ... Was just reading that on the BBC's website. ... Day in day out we hear about Muslims ... If you hear about Muslims stirring up race ...
    (uk.legal)
  • Re: Why does Juan support Zoom?
    ... I had actually seen your website years before reading ... CREDIBILITY is your most important asset. ... journalism that has lead to virtually all of his problems. ...
    (rec.aviation.homebuilt)
  • Re: Pair jailed for race-hate crimes
    ... Was just reading that on the BBC's website. ... first people convicted for this crime are white males? ... If you hear about Muslims stirring up race hatred on the web, ...
    (uk.legal)