#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc,char *argv[])
{
char buf[64]={0};
int fd=open(argv[1],O_RDONLY);
int fd2=open(argv[2],O_WRONLY);
if(argc!=3)
{
printf("Please enter %s srcfilename destfilename",argv[0]);
return -1;
}
if(fd<0)
{
perror("open");
return -1;
}
int ret=read(fd,buf,sizeof(buf));
write(fd2,buf,ret);
return 0;
}