ftell on a file descriptor?

前端 未结 1 1086
后悔当初
后悔当初 2020-12-16 09:37

Is there a way to do what ftell() does (return the current position in the file) on a raw file descriptor instead of a FILE*? I think there ought to be, since you can seek o

相关标签:
1条回答
  • 2020-12-16 10:05

    Just use:

    position = lseek(fd, 0, SEEK_CUR);
    
    0 讨论(0)
提交回复
热议问题