Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetDiskFreeSpaceEx() in WIN32API
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00315812
Message ID:
00318062
Vues:
46
>>>The function is available only with Win95 OSR 2 and later (as mentioned in my FAQ).
>>
>>Right, then I've modified your code so that it'll use getdiskfreespace() on computers that do not have OSR2 or later:
>>
>>if getversionex(@lcstruct) # 0
>> * Check if this is VER_PLATFORM_WIN32_WINDOWS
>> if stringtointeger(substr(lcstruct, 17, 4)) = 1
>> * Check if OSR2 or later
>> if stringtointeger(substr(lcstruct, 13, 4)) > 1000
>> *use new function... getdiskfreespaceex()
>> else
>> *use old function... getdiskfreespace()
>> endif
>> endif
>>endif
>>
>>It didn't work, the stringtointeger(substr(lcstruct, 13, 4)) > 1000 was .t. on a computer with Win 95 4.00.950a
>
>My error here. Use StringToInteger(SUBSTR(lcstruct, 13, 2)) > 1000. The build number is in the high order word. Let me know if this fixes it.
>
>BTW, why not use the DISKSPACE() function rather than GetDiskFreeSpace() or SYS(2020) for this?

Better would be to use the Scripting.FileSystemObject automation object from the WSH - the Drive object gets the information reliably regardless of the base platform...
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform