#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#define N 5200
int main(int agrc,char *argv[])
{
FILE *fp01 = NULL,*fp02 = NULL;
fp01 = fopen(argv[1],"rb");
fp02 = fopen(argv[2],"wb");
char ch_test[N];
if(NULL == fp01||NULL == fp02)
{
printf("文件操作错误!\n");
perror("错误原因:\n");
}
else
{
while(1)
{
fread(ch_test,1,2,fp01);
if(ch_test == EOF)
break;
fwrite(ch_test,1,2,fp02);
}
}
return 0;
}