I would like to respond to a failure of not being able to open a file by trying to open a different file, but it seems like if you fail once you're going to fail again even if you try to open a file that is really there:
Is there some way of revalidating the f object?Code:std::ifstream f; f.open(filename.c_str()); if(f.fail()) { // do something appropriate f.close(); f.open("data\\setpieces\\24x24_1_0_0.txt"); } // f will fail again even though the file I'm trying to open is really there