How to find size of file?

Gerhard Häring gh at ghaering.de
Thu Mar 4 20:15:37 EST 2004


Walter Huf wrote:
> Hi, I'm the same one with the CGI download problem. This time, however, I 
> want to send the client the size of the file that will be downloaded. How 
> would I find the size of the file, so I can include that in the headers? 

 >>> import os
 >>> os.stat("c:/tmp/x.html").st_size
567L

-- Gerhard



More information about the Python-list mailing list