| Previous | Next |
| EHOSTUNREACH | EPROCLIM |
ENOTEMPTY
Deletion is blocked by directory contents
ENOTEMPTY usually appears when an operation attempts to remove or replace a directory that still contains entries. It is not evidence that a filesystem is damaged. The remaining entry can be ordinary content, a hidden metadata item, a mount point interaction, or a concurrent creator that repopulates the directory between enumeration and removal.
A recursive cleanup should not treat this errno as permission denial. It should list the directory at the failure point, preserve the names and file types found, and handle races explicitly. Repeating removal without inspecting the entries can hide a producer that is still active.
Checks that distinguish common causes
- Capture a directory listing immediately after failure, including dotfiles and file types.
- Check whether another thread, process, sync client, or installer is creating entries concurrently.
- For rename-based deployment, verify whether the destination directory has to be empty under the filesystem’s rename rules.
References
Looking for a different code? Search another status or error code.