From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120 Description of problem: Creating an ifstream (or fstream with ios::in) object with openmode ios::ate and with the name of a non-existant file creates an empty file on the filesystem. // testprogram.cpp #include <fstream> using namespace std; int main(int,char**) { fstream fTest( "testfile", ios::in|ios::ate ); return 0; } Version-Release number of selected component (if applicable): 2.96-98 How reproducible: Always Steps to Reproduce: 1. # g++ testprogram.cpp -o testprogram 2. # rm -f testfile ; ./testprogram 3. # file testprogram Actual Results: $ file testfile testfile: empty Expected Results: $ file testfile testfile: can't stat `testfile' (No such file or directory). Additional info: ios::nocreate has not made it into the C++ Standard. Creating an input fstream object upon a non-existant file should fail without creating an empty file.
Reproducible on Skipjack beta2 with libstdc++-2.96-110.
Confirmed working ok in 8.0