Dave's Brain

Browse - programming tips - win32 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:

	static 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);
	}
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, 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.
Advertisements: