1.

Which of the following macro returns true if the file type is a directory?(a) S_ISREG(b) S_ISDIR(c) S_ISCHR(d) S_ISFIFOThis question was addressed to me during an interview.The origin of the question is File Handling System Calls topic in chapter System Programming I – Files of Unix

Answer»

Right option is (B) S_ISDIR

Explanation: The S_ISDIR MACRO RETURNS TRUE if the file type is a directory. The S_ISREG returns true if the file type is REGULAR.



Discussion

No Comment Found

Related InterviewSolutions