[python-win32] Size of directory

Tony Cappellini cappy2112 at gmail.com
Tue Apr 22 20:03:09 CEST 2008


When I right click on a directory with windows Explorer, a window is
displayed showing

Size:
Size On Disk:
Contains:
Created:
Attributes:
(with the appropriate values for each entry)


How do I get the same information via Python ?

I've looked at os.stat but

os.stat(r'C:\temp')[os.path.stat.ST_SIZE]

only returns the size of a "plain file" :(


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.

I guess I need to roll my own- once I know what the underlying call is to
get the size of each directory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080422/14e318ce/attachment.htm>


More information about the python-win32 mailing list