I have noticed the foolowing details regarding fstream.
the following combination of openstate flags do not truncate the files.
ios_base::out | ios_base::in | <any flag other than ios_base::trunc> ios_base::out | ios_base::app | <any flag other than ios_base::trunc>
the following combinations are resulting in a failbit
ios_base::app ios_base::ate ios_base::app | aos_base::ate
and all other combinations open the file but truncate it.
is this standard behaviour? the reason i ask this is that i find it very wierd that the following combination truncates the file
ios_base::ate | ios_base::out
if this is standard behaviour, then there seems to be no way to use ate with out. i.e create an output stream which doesnt truncate without using app.
please confirm this. and suggest a workaround(if possible for the above problem).