I am using Borland C++ v. 3.1 and want to find the free disk space on the hard
drive. I'm writing a DOS program, which is being used in a Windows NT DOS session.
I have a 2 GB NTFS hard drive.
When I use getdfree(), it is supposed to return the number of available
and total clusters, bytes per sector, and sectors per cluster. I've used
this function successfully on other systems, but it doesn't seem to be working
on this system. It returns the following:
available clusters: 31249
total clusters: 31249
bytes per sector: 512
sectors per cluster: 64
This gives a total and available disk space of 1,023,967,232 bytes -- or about
half of what is on the disk.
chkdsk returns (on an NTFS drive):
2096451 kilobytes total disk space.
385313 kilobytes in 6858 user files.
1444 kilobytes in 255 indexes.
12010 kilobytes in use by the system.
1697683 kilobytes available on disk.
512 bytes in each allocation unit.
4192902 total allocation units on disk.
3395367 allocation units available on disk.
Can anybody give me any insights as to whether this discrepency is due to
the disk size being too large for the getdfree() function, or if it is due
to the NTFS file system?
Any suggestions on how I can get the correct free disk space under these
circumstances? (The program must work under any and all DOS sessions -- i.e.,
NT, Win95, real DOS.)
Thanks in advance,
Marquette Electronics, Inc.