"r" is for reading, "w" is for writing, and "a" is for adding.
"t" is a text mode that is used in binary mode.
Several times here on SO, I saw people using rt and wt modes to read and write files.
Edit: Are you sure you saw rt, not rb?
These functions usually wrap the fopen function, which is described here:
http://www.cplusplus.com/reference/cstdio/fopen/
As you can see, it mentions using b to open a file in binary mode.
The referenced document link also refers to this mode b:
Adding "b" is useful even on systems that do not process binary and text files differently, where they serve in the documentation.
jussij Apr 14 '14 at 2:36 on 2014-04-14 02:36
source share