eccolo:
codice:void main(){ int fd,fd2,n; char buff[3]="abc"; char b[1024]; fd=open("newfile.txt",O_CREAT|O_RDWR,777); write(fd,buff,3); close(fd); fd=open("newfile.txt",O_CREAT|O_RDWR,777); fd2=open("copiafile.txt",O_CREAT|O_RDWR,777); while((n=read(fd,b,1024))>0){ write(fd2, b ,n);} close(fd); close(fd2); }

Rispondi quotando