C language--file operation mode

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.