subject

Ihave the following code where i have to replace the "" with the correct argument to run the code. i have no idea what these commands are or what the syntax is due to poor instructors. #include #include #include #include int main(int argc, char *argv[]){int const buf_size=10; int const extra_size=5; int inputfd, outputfd, openflags; mode_t fileperms; ssize_t numread; char buf[buf_size]; char buf1[extra_size]: char* inputfilename="input. txt"; char* outputfilename="output. txt"; inputfd = open(inputfilename, o_rdonly); if (inputfd == -1) printf("opening file %s", inputfilename); openflags = o_creat | o_wronly | o_trunc; fileperms = s_irusr | s_iwusr | s_irgrp | s_iwgrp | s_iroth | s_iwoth; /*rw-rw-rw */outputfd = open(outputfilename, open flags, fileperms); if (outputfd == -1) printf("opening file %s", outputfilename); while ((numread = read(inputfd, buf, buf_size)) > 0){ if (write(outputfd, , numread) ! = numread) printf("couldn't write while buffer"); if (write(outputfd, "extra", ) ! = extra_size) printf("couldn't write while extra buffer"); }if (numread == -1) printf("read"); if(close(inputfd) == -1) printf("close input"); if(close(outputfd) == -1) printf("close output"); inputfd = open(outputfilename, ); if (inputfd == -1) printf("opening file %s", outputfilename); while ((numread = read(inputfd, buf, buf_size)) > 0){ if (write (1, , ) ! = numread) printf("couldn't write whole buffer"); read(inputfd, buf1, 5); }write(1, "\n", 1); if (close(inputfd) == -1) printf("close input"); return(0); }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:30
What characteristic of long period comets suggest they come directly from the oort cloud?
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
Answers: 2
question
Computers and Technology, 24.06.2019 22:00
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
You know the right answer?
Ihave the following code where i have to replace the "" with the correct argument to run the code. i...
Questions
question
Mathematics, 24.06.2019 23:20
question
Mathematics, 24.06.2019 23:20
Questions on the website: 13722359