当前位置:网站首页>[Demo] 循环写文件
[Demo] 循环写文件
2022-06-30 15:48:00 【ykun089】
超过1G则回头写
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
struct timespec interval = {0,10};
char *a = "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
char *c = "qwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiopqwertyuiop";
int main(int argc,char** agrv)
{
long offset = 0;
constexpr long oneGB = 1024*1024*1024;
FILE* f = fopen("./loopwrite_test","wb+");
while(1){
offset = ftell(f);
if(offset>=oneGB){
rewind(f);
a = c;
}
fwrite(a,100,1,f);
fflush(f);
//nanosleep(&interval,NULL);
}
}边栏推荐
- Yunhe enmo won the bid for Oracle maintenance project of Tianjin Binhai rural commercial bank in 2022-2023
- Observation cloud reached in-depth cooperation with tdengine to optimize enterprise cloud experience
- 招标公告:深圳市财政局数据库异地灾备项目
- [BJDCTF2020]The mystery of ip|[CISCN2019 华东南赛区]Web11|SSTI注入
- 附加:(还没写,别看~~~)CorsFilter过滤器;
- Mathematical modeling for war preparation 34-bp neural network prediction 2
- Rongsheng biology rushes to the scientific innovation board: it plans to raise 1.25 billion yuan, with an annual revenue of 260million yuan
- In order to make remote work unaffected, I wrote an internal chat room | community essay
- 15年做糊21款硬件,谷歌到底栽在哪儿?
- POJ Project Summer
猜你喜欢

Undistorted resize using pil

Niuke network: longest continuous subarray with positive product

After 15 years of working on 21 types of hardware, where is Google?

restartProcessIfVisible的流程

【Verilog基础】关于Clock信号的一些概念总结(clock setup/hold、clock tree、clock skew、clock latency、clock transition..)
![[activity registration] it's your turn to explore the yuan universe! I will be waiting for you in Shenzhen on July 2!](/img/cf/6fc5f7cafbdc5e165eb119b9b41cd9.jpg)
[activity registration] it's your turn to explore the yuan universe! I will be waiting for you in Shenzhen on July 2!

halcon知识:区域专题【07】

抖快B为啥做不好综艺

备战数学建模33-灰色预测模型2

备战数学建模35-时间序列预测模型
随机推荐
There are so many kinds of coupons. First distinguish them clearly and then collect the wool!
容联云首发基于统信UOS的Rphone,打造国产化联络中心新生态
Li Zexiang, a legendary Chinese professor, is making unicorns in batches
Rong Lianyun launched rphone based on Tongxin UOS to create a new ecology of localization contact center
Deep learning - (2) several common loss functions
Hologres shared cluster helps Taobao subscribe to the extreme refined operation
MySQL开放远程连接权限的两种方法
Arcmap操作系列:80平面转经纬度84
【Verilog基础】十进制负数的八进制、十六进制表示
利用PIL进行不失真的resize
Siyuan notes: can you provide shortcut keys for folding all titles on the page?
Simpleitk encountered an ITK only supports orthonormal direction cosines error while reading NII
思源笔记:能否提供页面内折叠所有标题的快捷键?
Mathematical modeling for war preparation 36 time series model 2
Mysql8.0 method and steps for enabling remote connection permission
Exception class_ Log frame
安全帽佩戴检测算法研究
删除有序数组中的重复项 II[双指针--多情况统一]
抖快B为啥做不好综艺
赛芯电子冲刺科创板:拟募资6.2亿 实控人谭健为美国籍