#include<myhead.h>
int main()
{
char a[50]="kjlbnklas";
char b[50];
int fd1,fd2;
fd1=open("./1.txt",O_CREAT|O_TRUNC|O_WRONLY,0664);
if(fd1==-1)
{
perror("open");
return -1;
}
int len =write(fd1,a,sizeof(a));
close(fd1);
fd1=open(",/1.txt",O_RDONLY);
fd2=open("./2.txt",O_CREAT|O_TRUNC|O_WRONLY,0664);
if(fd2==-1)
{
perror("open");
return -1;
}
read(fd1,b,sizeof(b));
write(fd2,b,sizeof(b));
close(fd1);
close(fd2);
return 0;
}