1.

Which of the following system call is used for closing a file?(a) open(b) lseek(c) close(d) writeI have been asked this question in an online interview.The query is from System Calls Basics in portion System Programming I – Files of Unix

Answer»

Correct option is (c) CLOSE

To explain I would say: A PROGRAM automatically closes all open files before TERMINATION, but it’s a GOOD practice to close them explicitly. The close system CALL is used for closing a file.

int close (int fd)



Discussion

No Comment Found

Related InterviewSolutions