Date: Tue, 1 Aug 1995 10:16:05 +0000 (GMT) From: Torsten Schweigert To: linux-gcc Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: How to read a file binary Hi, I have the following problem: When running this program #include int main(void) { unsigned char buff; ofstream WriteFile("test.out",ios::bin); ifstream ReadFile("test.in",ios::bin); while(!ReadFile.eof()) { ReadFile.get(buff); WriteFile.put(buff); cout << buff; } return 0; } which simply should copy one file to another, it reads only on character and then exits. If I open the file in text mode all works well. Anybody a hint what I'm doing wrong? Torsten