您的位置:首页 > 其它

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);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: