ifstream file(filename.c_str()); if (file.eof()) { logfile.Print("EOF!"); } if (file.bad()) { logfile.Print("bad!"); } if (file.fail()) { logfile.Print("fail!"); }
"filename" is indeed set properly to the input received, according to the debugger. When stepping through this snippet, it steps into the if (file.fail()) block. However, when running the .exe, the logfile never shows a "fail!" line (and the logfile does get other output that I told it to print, so I know it's not a problem with logfile.).