1.

If rmdir dir001 fails, what could be the reason(s)?(a) dir001 doesn’t exist(b) dir001 is not empty(c) permissions of dir001 doesn’t allow to remove it(d) dir001 doesn’t exist, dir001 is not empty and permissions of dir001 doesn’t allow to remove itI had been asked this question at a job interview.I'd like to ask this question from File Handling Commands: pwd, cd in section The File System of Unix

Answer»

Right choice is (d) dir001 doesn’t exist, dir001 is not empty and permissions of dir001 doesn’t allow to REMOVE it

To elaborate: There could be MULTIPLE reasons which could lead to FAILURE while removing a directory. Major reasons could be:

->directory doesn’t exists.

->directory is not empty.

->permissions of directory doesn’t allow to remove it.



Discussion

No Comment Found

Related InterviewSolutions