LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I Get the Amount of Free Disk Space Using space using windows 7 please share example using GetDiskSpace

Solved!
Go to solution

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

0 Kudos
Message 1 of 6
(5,398 Views)

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.

0 Kudos
Message 2 of 6
(5,387 Views)

You can use Win32 API function GetDiskFreeSpaceEx: see attached example.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 6
(5,375 Views)
Solution
Accepted by topic author smartprogrammer

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 6
(5,349 Views)

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

0 Kudos
Message 5 of 6
(5,231 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 6 of 6
(5,221 Views)