Piotr wrote:
How to handle "lack of disk space" during the ostream::write() function. As
far as I know
the is ios::rdstate() function which returns 4-bit state flag:
badbit (critical error in stream buffer)
eofbit (End-Of-File reached while extracting)
failbit (failure extracting from stream)
goodbit (no error condition, represents the absence of the above bits)
but I would like to know if there was not enough free disk space to perform
the
ostream::write() operation.
How can I get that information ?
thank you
Disks are not required by the C++ specification, so there is
no method for checking free space _using_standard_C++_.
The proper procedure is to check for an ostream error,
then use some platform specific functions for determining
the cause of the problem.
One could also use some platform specific functions for
determining the free space before writing, provide the
platform has this support.
Read the FAQ and Welcome.txt links below.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book