Uchar recordlenth
When comparing recordlenth with integer int, you do not need to convert atoi to recordlenth. If conversion fails
3. lseek Function
Required header file: # include <unistd. h>
# Include <sys/types. h>/* defines off_t, pid_t, and Other types */
Function prototype: off_t lseek (int fd, off_t offset, int whence)
FD: file descriptor
Offset: Offset. The value can be positive or negative. The positive value is backward and the negative value is forward.
Whence: There are three parameters.
(1). seek_set: the current position starts with the file, and the new position is the offset size.
(2). seek_cur: The current position is the file pointer position, and the new position is the current position plus the offset size.
(3). seek_end: The current position is the end of the file, and the new position is the offset size.
Returned value: Successful: current file displacement
Failed:-1
O_append means that the flag is moved to the end of the file before each write. You cannot start with an o_append file unless you read the content of the file before writing, and then merge the content you want to write and read from the file, and then write it into the file. This can be achieved! O_append means that the flag is moved to the end of the file before each write. You cannot start with an o_append file unless you read the content of the file before writing, and then merge the content you want to write and read from the file, and then write it into the file. This can be achieved!