当前位置: 技术问答>linux和unix
请问linux下ftell函数的对应64位函数?
来源: 互联网 发布时间:2016-09-17
本文导语: windows下有这样两个函数:long ftell( FILE *stream ); __int64 _ftelli64( FILE *stream ); 我想在linux使用类似_ftelli64这样的函数,请问有没有类似的?谢谢。 | ftello,或者fgetpos 推荐用ANSI C 的 fgetpos...
windows下有这样两个函数:long ftell(
FILE *stream
);
__int64 _ftelli64(
FILE *stream
);
我想在linux使用类似_ftelli64这样的函数,请问有没有类似的?谢谢。
FILE *stream
);
__int64 _ftelli64(
FILE *stream
);
我想在linux使用类似_ftelli64这样的函数,请问有没有类似的?谢谢。
|
ftello,或者fgetpos
推荐用ANSI C 的 fgetpos
推荐用ANSI C 的 fgetpos
#include
int
fseek(FILE *stream, long int offset, int whence);
int
fseeko(FILE *stream, off_t offset, int whence);
long int
ftell(FILE *stream);
off_t
ftello(FILE *stream);
void
rewind(FILE *stream);
int
fgetpos(FILE * restrict stream, fpos_t * restrict pos);
int
fsetpos(FILE * restrict stream, const fpos_t * restrict pos);
|
在编译时使用 -D_FILE_OFFSET_BITS=64 (gcc) 定义 _FILE_OFFSET_BITS 宏为 64 即可
|
我在/usr/include/stdio.h里面找到这么一段:
这个ftello64可能就是楼主要找的函数吧。
#ifdef __USE_LARGEFILE64
extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence);
extern __off64_t ftello64 (FILE *__stream) __wur;
extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos);
extern int fsetpos64 (FILE *__stream, __const fpos64_t *__pos);
#endif
这个ftello64可能就是楼主要找的函数吧。
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。