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
Just use:
position = lseek(fd, 0, SEEK_CUR);