How to get a directory size with win32 api ?
dale at riverhall.NOSPAMco.uk
Mon Sep 17 21:30:40 CEST 2001
francois-regis.chalaoux at sanofi-synthelabo.com (copter24) wrote:
>How to get a directory size with win32 api ?
>Any code exemple ?
If you mean in terms of total kbytes occuplied, I don't think you can.
You can, however, use the FileSystemObject COM object which is part of
VBScript/JScript but I think can be used anywhere COM is accessible.
>>> from win32com.client import Dispatch
>>> fso = Dispatch("Scripting.FileSystemObject")
>>> fldr = fso.GetFolder("C:\\WINNT")
If you mean in terms of number of files, os.listdir() will probably do
Riverhall Systems Ltd
More information about the Python-list