Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Q: how to get the error from fstream << (http://www.velocityreviews.com/forums/t275975-q-how-to-get-the-error-from-fstream.html)

zhou 07-23-2003 09:08 PM

Q: how to get the error from fstream <<
 
Hi there,

I got an error when writing to a file via ofstream. Is there a way to get detailed reason for the error?
iosstate only has bad and good bits, no good enough to tell me what went wrong.

ofstream fs;
fs.open("aaa");
if ( fs << ....) {
// error
}

Thanks.

Yan



John Harrison 07-23-2003 09:11 PM

Re: how to get the error from fstream <<
 

"zhou" <yzhou@medplus.com> wrote in message
news:bfmtgh$g9d4g$1@ID-171337.news.uni-berlin.de...
> Hi there,
>
> I got an error when writing to a file via ofstream. Is there a way to get

detailed reason for the error?
> iosstate only has bad and good bits, no good enough to tell me what went

wrong.
>
> ofstream fs;
> fs.open("aaa");
> if ( fs << ....) {
> // error
> }
>
> Thanks.
>
> Yan


No, there is no portable way to get a detailed reason for the error.

john




All times are GMT. The time now is 01:18 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.