 | | One of the values the operating system associates with each file is the read/write offset, also called the file offset. The read/write offset specifies the “distance,” measured in bytes from the beginning of the file, at which the next read or write takes place. When a file is first opened or created, the file offset is zero (unless it was opened for appending); the first read or write starts at the beginning of the file. As reads and writes are performed, the offset is incremented by the number of bytes read or written each time. There is only one read/write offset for each file, so a read of 10 bytes followed by a write of 20 bytes leaves the read/write offset at 30. | |
|