| Previous | Next |
| ELNRNG | ENOMSG |
ENOTEMPTY
ENOTEMPTY means a directory-removal operation encountered a directory that still has entries other than the special self and parent links. The important question is not merely whether a file explorer view appears empty: hidden entries, another process creating a file concurrently, a mount or reparse-point boundary, and a difference between the checked path and the deleted path can all change the result.
For native Windows file APIs, retain the original API return value and GetLastError(); this UCRT status may be supplied by a compatibility layer rather than by the underlying API itself. Do not recursively delete on receipt of this status unless recursive removal is an intentional operation with a defined safety boundary.
Safe diagnostic sequence
- Resolve the target path before deleting and record the volume, final path, and whether the directory is a junction, symlink, or other reparse point.
- Enumerate entries immediately before the failing removal, including names not displayed by the application UI.
- Correlate the failure with concurrent writers, extractors, antivirus or indexing activity, and cleanup jobs.
- Use an atomic rename-then-cleanup design when a producer must stop publishing new entries before a directory is removed.
References
Looking for a different code? Search another status or error code.
