ios::binary opens the file in binary mode. In binary mode, special characters, such as newline & carriage return, are read as they are; they are not translated into escape sequences. Basically, what you read is what you get, not magic.
ios::ate sets the initial reading position to the end of the file. ios::trunc removes everything from the file before writing in the new data. Based on the behaviour of std::ofstream, this flag is initially set.
ios::app adds any new data to the end of the file. The old data remains unmodified.