fseek的包括FD(INT FD,而不是FILE *) [英] fseek for fd (int fd instead of FILE*)
本文介绍了fseek的包括FD(INT FD,而不是FILE *)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有fseek的包括FD的等效?我一直在使用INT FDS了很长的时间,并要使用fseek的......但我知道有没有搜索功能。
在此先感谢!
解决方案
查看POSIX函数 lseek的(2):
概要
的#include<&unistd.h中GT;off_t
lseek的(INT菲尔德斯,off_t偏移,INT何处);
说明
的
lseek的()
功能重新定位的文件描述符菲尔德斯
的说法偏移
,根据指令何处
。参数菲尔德斯
必须是一个开放的文件描述符。
块引用>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.
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.
这篇关于fseek的包括FD(INT FD,而不是FILE *)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文