Why can non-empty directories not be deleted directly? [self-answered]
[ Log in to get rid of this advertisement]
[This is a self-answered question. Just added for completeness.]
Deletion works by unlinking a file from the file system tree and marking the space it occupied as unused. If a directory was unlinked from the file system without deleting its contents first, the space occupied by those files would not be made free, so it would waste space.
This is why a non-empty directory can't just be deleted in a single operation.
|