The openmode element ios::ate of the Standard C++ I/O library does not work. When a file has been opened, the file position pointer is still at the beginning. This breaks any C++ program that use ios::ate upon opening a file to seek to the end of the file immediately, without doing an explicit seekg(0,ios::end). In RHL 5.2 it works fine.
#include <iostream.h> #include <fstream.h> int main(int, char*[]) { ifstream inFile("PUT_YOUR_FILENAME_HERE",ios::in|ios::binary|ios::nocreate|ios::ate); cout << "filesize is " << inFile.tellg() << ", but should be "; inFile.seekg(0,ios::end); cout << inFile.tellg() << endl; exit(0); }
assign to jakub