1. There are two ways to operate files under Linux: system calls and library functions.
- System calls: System calls occur in kernel mode and are oriented to low-level file access.
- Library function call: the so-called application programming interface API, which occurs in user mode and is application-oriented.
2. Library calls are part of the language or application, while system calls are part of the operating system.
3. Common system call functions
- fcntl file control
- open open file
- creat creates a new file
- close closes the file descriptor
- read read file
- write write file
- readv reads data from file into buffer array
- writev writes the data in the buffer array to the file
- pread random read from file
- pwrite writes randomly to the file,