Applied Wang Cong Patch, Check whether fstream::open() failed.