K
Kuhl
Hi, I am programming with C in Linux. During reading a file, I need to
rewind the file offset backwards sometimes. I learned that lseek()
function can check the offset. But I did not find a way to set the
offset. I tried using read(fd, databuf, -5), but the offset does not
go back. What's the correct way to rewind the file offset? Thanks.
rewind the file offset backwards sometimes. I learned that lseek()
function can check the offset. But I did not find a way to set the
offset. I tried using read(fd, databuf, -5), but the offset does not
go back. What's the correct way to rewind the file offset? Thanks.