5.16
来源:互联网 发布:淘宝上自然堂旗舰店 编辑:程序博客网 时间:2024/06/06 00:36
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<errno.h>
#define BUFFER_SIZE 1024
int main()
{
int aim_fd;
int i;
int bytes_write,bytes_read;
// char buffer[BUFFER_SIZE];
char str[]="hello";
char *ptr;/*,*stp=str*/
ptr=str;
if(aim_fd=(open("hello.txt",O_WRONLY|O_CREAT,0644))==-1)
{
perror("open error!");
exit(-1);
}
for(i=0;i<3;i++)
{
while(bytes_write=write(aim_fd,ptr,5))
{
if((bytes_write==-1)&&(errno!=EINTR))
break;
else if(bytes_write>0)
{
ptr+=bytes_write;
}
}
}
/* while(bytes_read==read(aim_fd,buffer,BUFFER_SIZE))
{
if((bytes_read==-1)&&(errno!=EINTR))
break;
else if(bytes_read>0)
{
}
}
printf("%s",buffer);*/
close(aim_fd);
}
阅读全文
0 0
- 5.16
- 5.16
- 5.16
- 5.16龙泉
- [5.16] 夜谈
- 5.16-2
- 签到 5.16
- Tomcat5.5.16 简单配置
- Tomcat5.5.16 简单配置
- 5.16 bluething's c
- Tomcat5.5.16 简单配置
- 5.16-5.20目标
- csapp2e 家庭作业 5.16
- Sample 5.16:textin1.cpp
- Activiti 5.16 用户手册
- Activiti 5.16 用户手册
- 建议 5.16 - 建议 5.18
- keil 5.16a使用
- 前端_CSS3新特性
- SIFT特征提取分析
- scikit-learn的1.11.4 Gradient Tree boosting学习与翻译
- JS事件委托
- 2016香港网络赛G题 未ac
- 5.16
- 图片验证码简单实现
- 基于Metronic的Bootstrap开发框架经验总结(9)--实现Web页面内容的打印预览和保存操作
- BZOJ 1191: [HNOI2006]超级英雄Hero 二分图匹配
- HRBUST 2326 Blind Father "尚学堂杯"哈尔滨理工大学第七届程序设计竞赛
- js的事件冒泡和事件捕获
- Python初遇问题5.16
- Appium 切换Webview模式,页面还停留在原来页面的问题
- Bootstrap栅格系统的精妙之处