Click to See Complete Forum and Search --> : GetDiskSpace Problem !!
M.Anand
April 26th, 1999, 03:28 AM
Hi
GetDiskSpace is giving a stange problem. it returns -ve value if the Disk space is more than 4 GB.
Is this an already existing bug ?
Anand
M.Anand
Development - Lead ,
Satyam Infoway Limited,
Chennai - 600034
India
Lothar Haensler
April 26th, 1999, 06:13 AM
from the docs:
"The GetDiskFreeSpace function returns incorrect values for volumes that are larger than 2 gigabytes"
use GetDiskFreeSpaceEx
M.Anand
April 26th, 1999, 06:24 AM
Hi
Thanks but I am using GetDiskFreeSpaceEx only. It is giving strange behaviour
Anand
M.Anand
Development - Lead ,
Satyam Infoway Limited,
Chennai - 600034
India
Rob Wainwright
April 26th, 1999, 04:14 PM
I haven't got the documentation to hand, but doesn't the GetDiskFreeSpaceEx function use two parameters (as any thing larger than two GB is not going to fit into one signed 4 byte value.
Rajaraman
April 27th, 1999, 12:48 PM
You have to use ULARGE_INTEGER to get the 64 bit value :
ULARGE_INTEGER available, total, free;
GetDiskFreeSpaceEx ("C:\\", &available, &total, &free);
//Separate out the 32 bit components :
DWORD low, high;
low = available.LowPart;
high = available.HighPart;
Rajaraman
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.