How do I 'stat' online files?

DB Daniel Brown dtbrown at ag.com
Tue Jul 24 15:07:49 CEST 2007


I am working on a program that needs to stat files (gif, swf, xml, dirs,
etc) from the web. I know how to stat a local file...


import os
tplStat = os.stat(path)

 

but I can't figure out how to stat a file that resides on a web server.
I am not sure if it makes a difference, but most (maybe all) of the
files that I need to stat reside within the same domain that will
generate the request. I am able to open the file by using

 

import urllib

f = urllib.urlopen(url)

 

but for some reason I cannot stat the files. Any help will greatly be
appreciated. Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070724/6bb8a187/attachment.html>


More information about the Python-list mailing list