07-16-2015 02:07 AM
How Can I Get the Amount of Free Disk Space using windows 7 please share example using GetDiskSpace i have already studied http://digital.ni.com/public.nsf/allkb/9958B8E473C4EF1786256BBC0053B64F
Solved! Go to Solution.
07-16-2015 02:56 AM
actually GetDiskSpace is not working fine in my case , i have 100 GB hard disk and GetDiskSpace works with 2GB. PLEASE GUIDE ME , I only want to save my file after knowing the available space on my disk.
07-16-2015 03:22 AM - edited 07-16-2015 03:23 AM
You can use Win32 API function GetDiskFreeSpaceEx: see attached example.
07-16-2015 04:00 AM - edited 07-16-2015 04:02 AM
Reading your question a bit more in detail, I doubt whether you are using Win32 API GetDiskFreeSpace function (for which my previous post is the solution) of Programmer's Toolbox GetDiskSpace function.
With reference to the second one, it works even with disks larger than 2GB but you need to use the proper formatting code to display the returned value. I updated my example to show total free space in the debug output window and added a comparison with 3GB value using UInt64TypeCompareUInt from the Programmer's Toolbox.
07-29-2015 12:56 AM
my respected friend the example you shared is no doubt very useful and covers all aspeects of my question but when i try to attach kernal32 with my previous project and when i call getvolumeinformation or Max_path then it gives error that prototype does not exist well i am already thanful to you for such great help in depth but some how i am unable to use it in my previous project although it runs fine independently
07-29-2015 01:57 AM
As listed in the Requirements section at the bottom of this MSDN page, you need to #include <windows.h> in your source code; be sure to add it before other includes.