开发者

fseek for fd (int fd instead of FILE*)

开发者 https://www.devze.com 2023-01-30 09:22 出处:网络
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中文版.

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 descriptor fildes to the argument offset, according to the directive whence. The argument fildes must be an open file descriptor.

0

精彩评论

暂无评论...
验证码 换一张
取 消