Article View: borland.public.cppbuilder.nativeapi
Article #6856Re: How to know the disk free space of a drive
From: Andrue Cope [TeamB]
Date: Thu, 07 Apr 2005 08:08
Date: Thu, 07 Apr 2005 08:08
25 lines
1878 bytes
1878 bytes
Christophe MINETTI wrote: > 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. > 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] http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID:
<4254ead7$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.banetele.no!uninett.no!news.net.uni-c.dk!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4254E1FB.53E94ED0@ulb.ac.be>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,82889fc6b282f000 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address> Subject: Re: How to know the disk free space of a drive Newsgroups: borland.public.cppbuilder.nativeapi References: <4254E1FB.53E94ED0@ulb.ac.be> Date: Thu, 7 Apr 2005 09:08:27 +0100 User-Agent: XanaNews/1.17.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 NNTP-Posting-Host: 217.207.223.34 Message-ID: <4254ead7$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1112861399 217.207.223.34 (7 Apr 2005 01:09:59 -0800) Lines: 25 X-Authenticated-User: acope Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.banetele.no!uninett.no!news.net.uni-c.dk!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail