Reprint Please specify source: http://blog.csdn.net/l1028386804/article/details/47450667
"RT" read-only open a text file, allowing only read data
"WT" only writes Open or create a text file, allowing only write data
"At" Appends open a text file and writes data at the end of the file
"RB" read-only open a binary file, allowing only read data
"WB" only writes open or create a binary file, allowing only write data
"AB" appends open a binary file and writes data at the end of the file
"rt+" read and write open a text file that allows read and write
"wt+" read/write open or create a text file that allows read and write
"at+" read and write open a text file, allow reading, or append data at the end of the file
"rb+" read and write open a binary file that allows read and write
"wb+" read-write open or create a binary file that allows read and write
"ab+" read and write open a binary file, allow reading, or append data at the end of the file
There are several explanations for how the file is used:
The file is used by r,w,a,t,b,+ six characters, the meaning of each character is:
R (Read): Read
W (write): Write
A (append): Append
T (text): Literal file, can be omitted without writing
B (banary): binary file
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
C language--file operation mode