2.close () function
The close () function closes the file opened by the open () function, which is invoked in the form of an int-close (int handle);
This function closes the file description Word handle the attached file.
Second, read and write functions
1.read () function
The call format for the read () function is:
int read (int handle, void *buf, int count);
The read () function reads the count bytes into the buffer referred to in BUF from the handle (file descriptor) file, the return value is the actual number of bytes read, and return 1 indicates an error. A return of 0 indicates the end of the file.
2.write () function
The call format for the write () function is:
int write (int handle, void *buf, int count);
The write () function writes count bytes from the buffer pointed to by the BUF to the handle-connected file, and the return value is the number of bytes actually written.
Third, random positioning function
1.lseek () function
The call format for the Lseek () function is:
int Lseek (int handle, long offset, int fromwhere);
This function locates the file position pointer attached to the handle, with the same functionality and usage as the fseek () function.
2.tell () function
The call format for the tell () function is: long tell (int handle);
This function returns the current location pointer of the file attached to the handle, with the same functionality and usage as Ftell ().