#include<head.h>
int main(int argc, const char *argv[])
{
if(argc!=3)
{
printf("外部传参错误\n");
return -1;
}
int fd,fd1;
fd=open("./1.txt",O_CREAT|O_TRUNC|O_WRONLY,0664);
if(fd==-1)
{
perror("open");
return -1;
}
char s[100]="qwertyuiop";
int len =write(fd,s,strlen(s));
close(fd);
fd1=open("./2.txt",O_CREAT|O_TRUNC|O_WRONLY,0664);
if(fd1==-1)
{
perror("open");
return -1;
}
int d=write(fd1,s,len);
printf("%s\n",s);
close(fd1);
return 0;
}