Dave's Brain

Browse - Programming Tips - How can I find the amount of free (available) diskspace?

Date: 2010nov30
Platform: win32

Q.  How can I find the amount of free (available) diskspace?

A.  Here's a function that does that:

BOOL GetDiskAvail(PULARGE_INTEGER avail) { return GetDiskFreeSpaceEx("C:\\", avail, NULL, NULL); } void ExampleUse() { ULARGE_INTEGER avail; GetDiskAvail(&avail); printf("free disk space = %dI64\n", avail.QuadPart); }

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.