c示例
2013-09-25 00:48
246 查看
//copy_block
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<stdio.h>
#include<stdlib.h>
int main(){
char c;
char block[1024];
int in,out,n;
in = open("file.in",O_RDONLY);
out = open("file.out",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
while((n=read(in,block,sizeof(block)))>0)
write(out,block,n);
exit(EXIT_SUCCESS);
}
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<stdio.h>
#include<stdlib.h>
int main(){
char c;
char block[1024];
int in,out,n;
in = open("file.in",O_RDONLY);
out = open("file.out",O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
while((n=read(in,block,sizeof(block)))>0)
write(out,block,n);
exit(EXIT_SUCCESS);
}
相关文章推荐
- JDIC浏览器组件的使用方法
- HttpServletResponse应用(转)
- fstat
- Mahout随机森林算法源码分析(3)--TestForest
- JAVA检测端口的占用情况
- 动态爬虫jsoup+jdic实现
- HttpServletRequest应用(转)
- Linux uniq命令
- 词频统计分析器
- Java数据类型与各数据库类型映射一览表
- 数据库学习
- FXO口应用场景
- 【内核】linux内核启动流程详细分析
- C语言示例
- SQL生成助记码的方法
- 对ioc和di的理解
- POJ 1502 Dijkstra最短路水题
- javascriptmvc—steal.clean
- 将Qt、OpenGL、GLSL以及Qt的Graphics-View框架结合
- CASIO显示屏驱动调试小结