Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetDiskFreeSpace and the like
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00620479
Message ID:
00621139
Views:
13
>>You've to specify in DECLARE that those parameter're passed by reference, properly initialize them and pass by reference to the function.
DECLARE LONG GetDiskFreeSpace IN kernel32 ;
>>	STRING, LONG @, LONG @, LONG @, LONG @
>>LOCAL ret, strDrive, lngSectors, lngBytes, lngFreec, lngTotalc
>>STORE 0 TO lngSectors, lngBytes, lngFreec, lngTotalc
>>ret = GetDiskFreeSpace(strDrive, @lngSectors, @lngBytes, @lngFreec, @lngTotalc)
>>? ret, lngSectors, lngBytes, lngFreec, lngTotalc
>>
>>
The function GetDiskFreeSpace has a bug. See faq #7847 for to how get correct info.
>
>Actually, it isn't a bug, it was a limitation based on the technology at the time it was written. Since any signed integer greater than 2gb is a negative number, the function caps the maximum result at that amount. This is why GetDiskFreeSpaceEx() uses a datatype known as ULARGE_INTEGER (an unsigned 64 bit integer. In reality, this is actually a structure made up of two DWORDs.

You're rigt. It's bad wording on my part.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform