

you then call getsize for each file returned by os.walk (which again calls GetFileAttributesEx).os.walk and os.listdir will perform additional memory allocation, string and array operations etc.os.walk then calls isdir for each file returned by os.listdir (which internally calls GetFileAttributesEx - or, prior to Win2k, a GetFileAttributes+ FindFirstFile combo) to redetermine whether to recurse or not.any additional system calls made from this point onward can only make you slower than Windows Explorer.

os.walk first calls os.listdir (which internally calls FindFirstFile/ FindNextFile).Python is unfortunately not your friend in this case. It's always there when you're viewing your folders (even in Open and Save file dialog boxes, you can change the view), and it's a great visual cue to help you find the one you're looking for.ĭon't switch to another program to see folder sizes.Windows Explorer almost certainly uses FindFirstFile/ FindNextFile to both traverse the directory structure and collect size information (through lpFindFileData) in one pass, making what is essentially a single system call per file. Not just for disk cleanup, but for any time you need to choose a folder.No scanning phase before you can start.


Folder Size for Windows adds a new column to the Windows Explorer details view that displays the sizes of files and folders. As soon as you display the Folder Size column, you'll see sizes immediately. A service scans your Folder Size for Windows - Browse /foldersize/2. Large folders will continue to scan in the background while you browse your folders. Background scans won't monopolize your disk.Explorer will automatically update the folder size column in real-time. When Folder Size detects that other programs are doing a lot of reading to and writing from the hard disk being scanned, the background scanning will wait for the other programs to finish.
