Board index » cppbuilder » How to know the disk free space of a drive

How to know the disk free space of a drive


2005-04-07 03:32:11 PM
cppbuilder99
Hi,
I would like to know how to get the disk free space of a specific hard
drive. I get the ID of this drive by a TDriveComboBox. I tried to use
the function DiskFreeSpace(byte aDrive) but how to make the link between
aDrive and the actual Drive listed from the TDriveComboBox ?
Many thanks in advance.
Christophe
 
 

Re:How to know the disk free space of a drive

Christophe MINETTI wrote:
Quote
I would like to know how to get the disk free space of a specific hard
drive. I get the ID of this drive by a TDriveComboBox.
The 'ID'? I assume you mean the drive letter.
Quote
I tried to use
the function DiskFreeSpace(byte aDrive) but how to make the link
between aDrive and the actual Drive listed from the TDriveComboBox ?
I don't know of a function DiskFreeSpace(). I do know of DiskFree()
though and the help for it clearly states how to use it:
From the help:"DiskFree returns the number of free bytes on the
specified drive, where 0 = Current, 1 = A, 2 = B, and so on."
Alternatively since you have posted to the .native API you could use
GetDiskFreeSpace() which is an API call. Here it's even easier. This
function whats the root directory so just take the drive letter
returned by the combo box and append ":\\".
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html