How to get a directory size with win32 api ?

Paul Winkler slinkp23 at yahoo.com
Mon Sep 17 15:48:37 EDT 2001


On Mon, 17 Sep 2001 20:30:40 +0100, Dale Strickland-Clark 
<dale at riverhall.NOSPAMco.uk> wrote:
>francois-regis.chalaoux at sanofi-synthelabo.com (copter24) wrote:
>
>>Hi,
>>
>>How to get a directory size with win32 api ?
>>Any code exemple ?
>>
>>FR
>
>If you mean in terms of total kbytes occuplied, I don't think you can.

You could always do it the hard way: use os.path.walk() with a visit
function that uses os.path.getsize() and keeps a total of the
results. This approach would be platform-independent.

--PW



More information about the Python-list mailing list