Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DISKSPACE() Function for large drives under FP 2.5
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00242500
Message ID:
00242560
Views:
16
>Hello,
>
>We have a legacy application running under FoxPro 2.5 with the clients running Windows 95 or Windows NT 4.0. In some situations, they are working with compressed (ZIP) databases that are often copied to the local PC drive for extra speed and write capability. Our application makes use of the DISKSPACE() function to determine if there will be enough free space on a given drive before attempting to load the data.
>
>Now, the problem (as I've known for a while) is that this function will not reliably return the correct free space. The maximum it returns is 1gb of free space and compressed data fitting on 650MB CD-ROM will unexpand to much more than this in many cases.
>
>Has anyone written an FLL or alternative FoxPro function that will return at minimum 2gb free (if there is at least that much free). One solution I have so far is to call the WINAPI32 function GetDiskFreeSpace() from an FLL. I am able to call it from VFP 5.0 using the DECLARE statement but this feature doesn't seem to exist in 2.5. :-/
>

There's a Win16 equivalent to this, which would be accessible using FoxTools REGFN() and CALLFN() (I don't know what the systax would be IAC for the Win16 API call IAC) and you're stuck with Win16, not Win32 IAC with FPW2.5/2.6, and the Win16 API call is the underlying basis for DISKSPACE. Your ownly recourse will be to find a function that returns the number of free disk clusters (SYS(2022) will return the cluster size) and then do the math, since the minimum cluster size would be at least 512 bytes (if an NTFS disk volume were involved) and under FAT it would be 2K or larger...

>Thanks in advance!
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform