|
|
|
Finding The Default Drive Free Space Comments The free space on the default drive can be found with the DiskFree function. This is part of SysUtils, which should be declared in your uses clause. The value returned is in bytes. You can also get the free space on other drives. DiskFree(0) returns the default drive space; but [usually] DiskFree(1) would return the space on A:. DiskFree(2) for B:, DiskFree(3) for C:, and so on. Caution with this, though, as not all systems are configured the same way in hardware. DiskFree will return -1 if a drive is unavailable (for example, no diskette in the A: drive). DiskFree is especially useful when checking to see if an application has room to install, or if your application uses large data or image or multimedia files that might possibly exceed available space. . |