avatar
i*d
1
Hi, I have a question about the fprintf in C\C++. Usually we open a file
with fopen,
write data to that file with fprintf. Before we close the file, however, we
may see that the date file is essentially empty, meaning that the program
just wrote the data to some buffer, instead directly wrote them to the hard
driver. So my question is:
is there any function which would force fprintf write data to hard driver at
the real time or with the minimum delay?
Many thanks!
avatar
a*s
2
No, it is controlled by OS.
avatar
T*i
3
fflush

we
hard
at

【在 i****d 的大作中提到】
: Hi, I have a question about the fprintf in C\C++. Usually we open a file
: with fopen,
: write data to that file with fprintf. Before we close the file, however, we
: may see that the date file is essentially empty, meaning that the program
: just wrote the data to some buffer, instead directly wrote them to the hard
: driver. So my question is:
: is there any function which would force fprintf write data to hard driver at
: the real time or with the minimum delay?
: Many thanks!

avatar
n*a
4
set fflush as NULL
man fflush

【在 a***s 的大作中提到】
: No, it is controlled by OS.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。