L
Lars Uffmann
Thanks, that's all I needed to know, really:kwikius said:AFAIK you can control some aspects of exception throwing in regard to
the state flags, via exceptions(flags) member function in basic_ios.
/* ... */
indexFile.exceptions (ios_base::failbit);
try {
indexFile.open (filename, ios_base::binary | ios_base::in | ios_base:ut);
}
catch (exception &e) {
cout << "file not open" << endl;
}
if (!indexFile.is_open()) {
cout << "creating index file" << endl;
indexFile.clear();
indexFile.open (filename, ios_base::binary | ios_base:ut |
ios_base::app);
}
/* ... */
That kinda does what I wanted to do - the only thing I don't like being
that it throws the exception when the failbit is SET - and I really
would have preferred if the exception was thrown when a succeeding
operation failed _because_ of the set failbit :/
Np, that's what references are for - you pointed me in the rightThat said, I'm pretty flakey about the details.
direction
Best Regards,
Lars