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, 21.06.2019 21:00
If you have a lien on your vehicle, you cannot apply for a duplicate copy of your vehicle’s certificate of title. true or false
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
You have read about the beginnings of the internet and how it was created. what was the internet originally created to do? (select all that apply) share research. play games. communicate. share documents. sell toys
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Which of the following terms refers to a collection of different types of software that share the goal of infiltrating a computer and making it do something? a- malware b- virus c- spyware d- trojan horse
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
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
History, 23.05.2020 05:58
question
Mathematics, 23.05.2020 05:58
question
Mathematics, 23.05.2020 05:58
question
Spanish, 23.05.2020 05:58
question
Mathematics, 23.05.2020 05:58
Questions on the website: 13722361