读取不断增长的文件 [英] Reading a growing file

查看:62
本文介绍了读取不断增长的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果遇到 feof(),然后 stat 显示文件已增长,是否有一种无需执行 fclose() fopen()?

If I encounter feof() and then stat shows that the file has grown, is there a way to read the added data without doing a fclose() and fopen()?

推荐答案

是.您可以在文件上调用 clearerr ,或执行任何查找操作,例如 fseek(f,0,SEEK_CUR).

Yes. You can call clearerr on the file, or perform any seek opereration such as fseek(f, 0, SEEK_CUR).

这篇关于读取不断增长的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆