#include
#include
#include
#include
void main(int argc,char **argv)
{
int fd_s;
int fd_t;
char buf[512];
int count =0;
/*打开文件*/
fd_s = open(argv[1],O_RDONLY);
fd_t = open(argv[2],O_RDWR|O_CREAT,0666);
/*读取文件,写入文件*/
while((count = read(fd_s, buf,512) ) >0)
write(fd_t, buf,count);
close(fd_s);
close(fd_t);
}
阅读(702) | 评论(0) | 转发(0) |