#include<sys/types.h> #include<stdio.h> #include<fcntl.h> int main(){ char a[30]; int i,j; i=open("/home/cvr/f1.txt",O_RDONLY); j=open("/home/cvr/f2.txt",O_CREAT | O_RDWR,S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); while(read(i,&a,1)){ write(j,&a,1); } printf("copied succesfully"); close(i); return 0; }