Linux low-level IO and advanced IO

Source: Internet
Author: User
Open file int open (const char *path, int access,int mode)
FILE *fopen (Char *filename, char *mode)

The difference between open and fopen:
The former belongs to low-level IO, the latter is advanced IO.
The former returns a file descriptor, which returns a file pointer.
The former has no buffer, the latter has buffer.
The former is used in conjunction with read, write, etc., the latter with Fread, fwrite and so on.
The latter is expanded on the basis of the former, in most cases with the latter.
Turn off file int close (int fd)

int fclose (FILE *stream)

The difference between close and fclose:
The former belongs to low-level IO, the latter is advanced IO.
The former is used in conjunction with open (), and the latter is used in conjunction with fopen (). Write file size_t fwrite (const void *ptr, size_t size, size_t nmemb,file);

int fprintf (FILE *stream, const char *format, ...);

Fwrite () and fprintf () are advanced IO. Fwrite () is a binary way to write a file, fprintf () is the formatted data to write to the 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.