![]() |
|
Published 1999-07-06 Printer-friendly version
Courtesy Of TS Resources Inc.
If you've ever needed to determine how much free space there is on a drive, and you're doing 32 bit development, you'll want to get the freeware drive freespace dll from TS Resources Inc. (Rob Cohan).
This is a C language DLL which can be called by Clarion 32 bit applications, and which returns accurate disk free space figures for all 32 bit Microsoft Windows operating systems. It uses internal dynamic linkage to avoid the problems associated with statically linking the accurate, advanced functions which are not available in the original releases of Windows 95.
To use this DLL in your application choose Application|Insert
Module from the main menu, and select a module of type ExternalLib
(External Library Module). Fill in the Name and Map Include File
fields as shown in Figure 1. The spc.mif file contains the
prototype for the spc function.

The zip file contains an example application.
The spc function usage is straightforward
result = spc( cstring *DriveLetter, long Mode )
Driveletter is a cstring of at least two bytes
length (one character plus the requisite terminating NULL character
space.)
Mode can be one of the following:
Under Windows 2000, a mode of 1 is intended to get
free space allocated to the present user.
spc returns a numeric cstring to allow
for future variability in the size of number reported. Due to
Clarion's automatic type conversions, you can use this result
directly as a number in most cases, even when formatting the
result, as shown in Listing 1.
csDriveLetter = clip(DriveLetter)&'<0>' !turn into cstring) FreeSpaceNow = format( spc(csDriveLetter, 1), @n15) TabulaRasa = format( spc(csDriveLetter, 2), @n15) Utilized = format( spc(csDriveLetter, 3), @n15)
Many thanks to TS Resources Inc. for making this utility available!
Download the dll and example application.
|
Posted on Tuesday, June 06, 2006 by Dave Harms The download is no longer available from that site, but there is another article by Andrew Guidroz which shows how to get drive free space: http://www.clarionmag.com/cmag/v6/v6n05drivetype.html |
To add a comment to this article you must log in.
Copyright © 1999-2008 by CoveComm Inc. All Rights Reserved. Reproduction in any form without the express written consent of CoveComm Inc., except as described in the subscription agreement, is prohibited.
Clarion Magazine ISSN 1718-9942
One year: $189
(includes all back issues since '99)
Renewals from $139
Two years: $289
Renewals from $239