Hi, I'm a little stuck,
I basically need to copy all the information within a specific file in Temp and append it to a file in another location.
I'm not having any problems with smaller size log files stored within temp foldier and everything reads and appends perfectly, however when i try to read and append from IS12Install.log file in Temp all it appends to my destination file is:
ÿþ=
and a whole bunch of empty lines
I believe that this is an encoding issue..
I thought that i might solve this by using the binary read and binary write(append) ios::binary to get around this issue...
1) Why is this happening? I've noticed that the log file is 2.5mb might this be the issue?
2) Will ios::binary solve this issue?
3) If i do read and write(append) binary what i need to do to convert the binary back to letters before i write(append) the information?
4) Any other ideas of what might be happening and how to solve this issue?
Here is a chunk of my code:
//OPEN BOTH SOURCE AND DESTINATION FILES FOR READING AND WRITING/APPENDING
fstream file_in(SrcFile ,ios::in);
fstream file_out(DestFi le,ios::app);
//READ FROM SOURCE FILE
//APPEND EVERYTHING TO DESTINATION
char str[2000];
while(!file_in. eof())
{
file_in.getline (str,2000);
file_out << "\n" << str;
}
file_out << endl;
//CLOSE BOTH SOURCE AND DESTINATION FILES
file_in.close() ;
file_out.close( );
Thanks in advance
Alex