I've been testing out some code I wrote on a test program. Although GDB doesn't catch anything and it runs fine, it's supposed to generate output files. It did that at first, but after debugging various other aspects of the test program, it doesn't generate any files at all. Extensive debugging of that yielded nothing.

The strange part is I started another test -- copy/pasted/compiled the fstream example from cplusplus.com and even *that* didn't generate files. I added a simple "cout << filestr.fail() << endl;" statement and the compiled example always outputs a 1.

I'm running these tests with root privileges, plenty of memory, and 92 GB of free disk space. The fact that not even a simple C++ code snippet from a reference site generates files is eerie. This is the said snippet, with the failbit check I added and a test I/O operation:

Code:
#include <iostream>
#include <fstream>
using namespace std;

int main () {

  fstream filestr ("test.txt", fstream::in | fstream::out);
  cout << filestr.fail() << endl;

  filestr << " dsgesvsvds";

  filestr.close();

  return 0;
}