How to check for remaining hard drive space in Windows?

Jerry Hill malaclypse2 at gmail.com
Wed Feb 28 17:08:34 EST 2007


On 2/28/07, Tim Golden <mail at timgolden.me.uk> wrote:
> Well it's not often someone beats me to a WMI
> solution :) Just to be different, you can also
> look at the GetDiskFreeSpace function in the
> win32api module of the pywin32 extensions.

The MSDN page for that function warns:
"The GetDiskFreeSpace function cannot report volume sizes that are
greater than 2 gigabytes (GB). To ensure that your application works
with large capacity hard drives, use the GetDiskFreeSpaceEx function."

Make sure to keep that in mind if you're recording free disk space
someplace, rather than just checking for enough space to do an install
or something.

-- 
Jerry



More information about the Python-list mailing list