<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY><!--ppd1000034-->
<DIV dir=ltr align=left><SPAN class=483421918-22042008><FONT face=Arial
color=#0000ff size=2>You have to walk the directory tree and sum each file's
size. Windows does this too - try your right-click properties on a large
directory and see how long it takes. That's also what du does. There
are, however, some recipes that should make this fairly simple for you - try
this:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=483421918-22042008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=483421918-22042008><FONT face=Arial
color=#0000ff size=2><A
href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86554">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86554</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=483421918-22042008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=483421918-22042008></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
python-win32-bounces+rdahlstrom=directedge.com@python.org
[mailto:python-win32-bounces+rdahlstrom=directedge.com@python.org] <B>On Behalf
Of </B>Tony Cappellini<BR><B>Sent:</B> Tuesday, April 22, 2008 2:03
PM<BR><B>To:</B> python-win32@python.org<BR><B>Subject:</B> [python-win32] Size
of directory<BR></FONT><BR></DIV>
<DIV></DIV><BR>When I right click on a directory with windows Explorer, a window
is displayed showing<BR><BR>Size:<BR>Size On
Disk:<BR>Contains:<BR>Created:<BR>Attributes:<BR>(with the appropriate values
for each entry)<BR><BR><BR>How do I get the same information via Python
?<BR><BR>I've looked at os.stat but
<BR><BR>os.stat(r'C:\temp')[os.path.stat.ST_SIZE] <BR><BR>only returns the size
of a "plain file" :(<BR><BR><BR>It's really a shame that windows doesn't have a
built-in tool to show you a tree of subdirectories, and how much space is
occupied by each subdirectory.<BR><BR>I guess I need to roll my own- once I know
what the underlying call is to get the size of each directory<BR><BR><BR><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt"><FONT size=1><FONT color=navy><FONT face=Arial>DISCLAIMER:<BR>This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and<BR>may contain legally privileged and/or confidential information. If you are not the intended recipient<BR>of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and<BR>any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify<BR>me and permanently delete the original and any copy of any e-mail and any printout thereof.<BR>E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept<BR>liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission.<BR style="mso-special-character: line-break"><BR style="mso-special-character: line-break"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt"><FONT size=1><FONT color=navy><FONT face=Arial>NOTICE REGARDING PRIVACY AND CONFIDENTIALITY<BR>Direct Edge ECN LLC may, at its discretion, monitor and review the content of all e-mail communications.<o:p></o:p></FONT></FONT></FONT></SPAN></P><P><SPAN style="FONT-SIZE: 10pt; COLOR: navy"><A href="http://www.directedge.com/"><FONT face=Arial color=navy size=1>www.directedge.com</FONT></A></SPAN></P></BODY></HTML>