The difference between open and fopen:
1. Buffer File System
The features of the buffered file system are: In memory, a "buffer" is used for every file in the program, and when a read file is performed, the data is read into the memory "buffer" from the disk file, filled and then read into the received variable from the memory "buffer". When a write file is performed, the data is written to the memory "buffer", and the Memory "buffer" is filled before it is written to the file. From this can be seen, the size of the memory "buffer", affecting the actual operation of the external memory, "buffer" the larger, the operation of the external storage of the number of times, the implementation of fast, high efficiency. In general, the size of the file "buffer" varies depending on the machine.
fopen, Fclose, Fread, Fwrite, fgetc, Fgets, FPUTC, fputs, freopen, etc.
2. Non-buffered file system
Buffer file system is the use of file structure pointer to file management, through file pointers to file access, can read-write characters, strings, formatted data, can also read and write binary data. Non-buffered file systems depend on the operating system, through the function of the operating system to read and write the file, is the system-level input and output, it does not set the file structure pointer, can only read and write binary files, but high efficiency, speed, because the ANSI standard no longer include a non-buffered file system, it is recommended that you do not choose it. This book is only for a brief introduction. Open, close, read, write, getc, GetChar, PUTC, Putchar, etc.
Open is the file handle returned by the system call, and the file's handle is the index of the file in the file description list.
Fopen is a library function of C that returns a pointer to the file structure.