This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++-v3 3.4.4: fstream does not create a file on open


Hi Francesco,

Hi,
when I try to connect a non existent file to an fstream object calling
the open member function, the file is not created.

This is the behavior mandated by the standard: the default openmode for an fstream is "in | out", which is the same as "r+" in C. You can change it, use for example "out", or use an ofstream. Here and elsewhere, since we are talking about free software, I suggest having a look to the source code for fstream, there are rather extensive comments...

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]