#include #include #include #include #include int main(int argc, char** argv){ if (argc<5){printf("Please add input file and three output files to command line arguments\n");exit(1);} int run=1; // How many times to copy the input file for each test int bufsz=5; char array[bufsz]; int b=0; int i; time_t unbuf_s,unbuf_e,buf1_s,buf1_e,buf2_s,buf2_e; FILE * read_f; FILE * write_f; //Unbuffered IO printf("Unbuffered\n"); int read_fd=open(argv[1],O_RDONLY); int write_fd=open(argv[2],O_WRONLY | O_CREAT); unbuf_s=time(NULL); for(i=0; i0); lseek(read_fd, 0, SEEK_SET); } unbuf_e=time(NULL); close(read_fd); close(write_fd); //Buffered IO with flushing printf("Buffered with flushing\n"); read_f = fopen(argv[1],"r"); write_f = fopen(argv[3],"w"); buf1_s=time(NULL); for(i=0; i