Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 5 review At the beginning of a program, what is the value of fd after ‘fd = open(…);’ is executed? What is file no 0? What is file no 1? What is.

Similar presentations


Presentation on theme: "Lecture 5 review At the beginning of a program, what is the value of fd after ‘fd = open(…);’ is executed? What is file no 0? What is file no 1? What is."— Presentation transcript:

1 Lecture 5 review At the beginning of a program, what is the value of fd after ‘fd = open(…);’ is executed? What is file no 0? What is file no 1? What is file no 2? Rewrite ‘cout << “abc”;’ using a system call Rewrite ‘fprintf(stderr, “%s”, str);’ using a system call. Give two ways to redirect standard input to a file “aaa” How to redirect standard error and standard output to the same file with cerr and cout not overwriting each other? Does execv erase the file descriptor table?

2 What can happen when we use cout and write (1) in the same program
What can happen when we use cout and write (1) in the same program? Will the order in the code be honored in the standard output file? Can we enforce the order?


Download ppt "Lecture 5 review At the beginning of a program, what is the value of fd after ‘fd = open(…);’ is executed? What is file no 0? What is file no 1? What is."

Similar presentations


Ads by Google