C language file operations

Source: Internet
Author: User

"RT" only opens a text file and only supports reading data.
"WT" only writes to open or create a text file, only data can be written
Append "at" to open a text file and write data at the end of the file.
"Rb" is used to open a binary file and only read data.
"WB" only writes to open or create a binary file, only data can be written
Append "AB" to open a binary file and write data at the end of the file.
"RT +" reads and writes to open a text file, allowing reading and writing
"WT +" reads and writes to open or create a text file, allowing reading and writing
"At +" to open a text file, allow reading, or append data at the end of the file
"RB +" reads and writes a binary file, allowing reading and writing
"WB +" to open or create a binary file and allow reading and writing
"AB +" reads and writes to open a binary file, allowing reading or appending data at the end of the file

The usage of files is described as follows:

The usage of a file is composed of R, W, A, T, B, and +. The meanings of each character are as follows:

R (read): Read
W (write): Write
A (append): append
T (text): Text File, can be omitted without writing
B (banary): Binary File

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.