| Previous | Next |
| STATUS_FILE_CORRUPT_ERROR | STATUS_BAD_LOGON_SESSION_STATE |
STATUS_NOT_A_DIRECTORY
STATUS_NOT_A_DIRECTORY means that the target name exists, but it is not a directory even though the requested operation required one. This can occur while opening a directory, resolving a child path, requesting directory-specific metadata, or using a create option that requires a directory object.
Typical causes
- A configuration value that should contain a folder instead contains a file path.
- A path component was replaced by a file, so a later child lookup cannot continue through it.
- Code attempts to create a directory where a regular file already exists.
- A remote share or virtual file system cannot represent the requested directory or stream layout.
Useful distinction
STATUS_NOT_A_DIRECTORY is not a missing-path result. The object was found, and its type is the reason the request failed. It is also the inverse of STATUS_FILE_IS_A_DIRECTORY, which means that a file-only request reached a directory. Logging both the requested object type and the discovered object type helps identify the actual mismatch.
Correct the path or select an operation appropriate for the discovered object. Retrying without changing the request does not help, because this is a deterministic type conflict rather than a temporary lock or I/O condition.
See File-system open processing, SMB2 CREATE rules, and the NTSTATUS reference.
Looking for a different code? Search another status or error code.