1.

truncate needs the ___ of the file as an argument but ftruncate works with _______(a) pathname, file descriptor(b) file descriptor, pathname(c) pathname, pathname(d) file descriptor, file descriptorI got this question in a national level competition.Asked question is from System Calls Basics in section System Programming I – Files of Unix

Answer»

Correct option is (a) pathname, file descriptor

Explanation: The truncate and ftruncate CALLS can truncate a file to any LENGTH. truncate NEEDS the pathname of the file as an argument but ftruncate WORKS with the file descriptor.



Discussion

No Comment Found

Related InterviewSolutions