Is there an equivalent of fseek for fd? I've been using int fds for a very long time, and want to use fseek... but I know there is no seek function开发者_StackOverflow中文版.
Thanks in advance!
See the POSIX function lseek(2):
SYNOPSIS
#include <unistd.h> off_t lseek(int fildes, off_t offset, int whence);
DESCRIPTION
The
lseek()
function repositions the offset of the file descriptorfildes
to the argumentoffset
, according to the directivewhence
. The argumentfildes
must be an open file descriptor.
精彩评论