#include #include #include #include #include #include #include using namespace std; int main() { int file1,file2,file3,file4,bsize; file1 = creat("/home/8/kimjas/660/abc1.txt",S_IRWXU); close(file1); file2 = creat("/home/8/kimjas/660/abc2.txt",S_IRWXU); close(file2); file1 = open("/usr/class/cis660/x.x",O_RDONLY); char buf[BUFSIZ]; file2 = open("/home/kimjas/abc1.txt",O_RDWR); file3 = open("/home/kimjas/abc2.txt",O_RDWR); read(file1,buf,10); write(file2,buf,10); bsize = read(file1,buf,20); write(file3,buf,20); while(bsize >= 20) { read(file1,buf,10); write(file2,buf,10); bsize = read(file1,buf,20); write(file3,buf,20); } return 0; }