arrow
arrow
arrow
Consider a hierarchical file system. If a user attempts to delete a non-empty directory using a standard 'delete directory' command without any r
Question

Consider a hierarchical file system. If a user attempts to delete a non-empty directory using a standard 'delete directory' command without any recursive options, what is the most likely outcome?​

A.

The operating system will automatically delete all files and subdirectories within it.

B.

The operating system will prompt the user for confirmation to delete each item within the directory.

C.

Only the directory structure will be removed, leaving the files and subdirectories orphaned.

D.

The operating system will return an error indicating that the directory is not empty.

Correct option is D

The correct answer is:(d) The operating system will return an error indicating that the directory is not empty.

Explanation:
When a user attempts to delete a non-empty directory using the standard delete directory command (without any recursive options), the operating system typically prevents the operation and returns an error message, indicating that the directory is not empty. This is because, in most file systems, directories must be empty before they can be deleted unless a recursive delete command is used.

Information Booster:

  • In a hierarchical file system, directories can contain files and other subdirectories, and these must be deleted before the parent directory can be removed.
  • Recursive delete options (e.g., rm -r in Unix/Linux) are required to remove the contents of a directory before the directory itself is deleted.
  • File system safety: Most modern operating systems prevent the accidental loss of files and directories by requiring explicit confirmation or recursive options for deletion.
  • The typical error message will be something like "Directory not empty" or "Cannot delete directory".

Additional Information:

  • (a) The operating system will automatically delete all files and subdirectories within it: This is incorrect because recursive options are necessary for deleting non-empty directories and their contents automatically.
  • (b) The operating system will prompt the user for confirmation to delete each item within the directory: This is more common in graphical user interfaces (GUIs) or specific delete commands with confirmation prompts, not the standard delete directory command.
  • (c) Only the directory structure will be removed, leaving the files and subdirectories orphaned: This is incorrect because most operating systems will not delete an empty directory and leave the files orphaned unless force deletion is specified.

Free Tests

Free
Must Attempt

CBT-1 Full Mock Test 1

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon90 Mins
languageIcon English
Free
Must Attempt

RRB NTPC Graduate Level PYP (Held on 5 Jun 2025 S1)

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon90 Mins
languageIcon English
Free
Must Attempt

CBT-1 General Awareness Section Test 1

languageIcon English
  • pdpQsnIcon40 Questions
  • pdpsheetsIcon30 Marks
  • timerIcon25 Mins
languageIcon English
test-prime-package

Access ‘RRB NTPC’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
354k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow