Sagar Choudhary wrote:
Is there any exception related to disk space ?
If not how else can we check the availability of the disk space in a
c++ program. I know ostream helps a bit. When we try to open a file
when there's no disk space ostream::rdstat e() returns badbit.
IIRC, that's a platform specific thing that you'll want to look into the
platform documentation for. I'm not aware of any standard C++ way of
finding how much space is free (apart from the ostream being writable
and it... not being writable or, as you pointed out, returning an error).
For example, the Microsoft Windows PlatformSDK offers:
BOOL GetDiskFreeSpac e(
LPCTSTR lpRootPathName,
LPDWORD lpSectorsPerClu ster,
LPDWORD lpBytesPerSecto r,
LPDWORD lpNumberOfFreeC lusters,
LPDWORD lpTotalNumberOf Clusters
);
(include windows.h)
http://msdn.microsoft.com/library/de...kfreespace.asp
--
Peter MacMillan
e-mail/msn:
pe***@writeopen .com
icq: 1-874-927
GCS/IT/L d-(-)>-pu s():(-) a- C+++(++++)>$ UL>$ P++ L+ E-(-) W++(+++)>$
N o w++>$ O !M- V PS PE Y+ t++ 5 X R* tv- b++(+) DI D+(++)>$ G e++ h r--
y(--)