Site icon EfmSoft

What does NTSTATUS 0xC00000BA (STATUS_FILE_IS_A_DIRECTORY) mean?

 
Previous Next
STATUS_COULD_NOT_INTERPRET STATUS_NOT_SUPPORTED

STATUS_FILE_IS_A_DIRECTORY

STATUS_FILE_IS_A_DIRECTORY is a type mismatch. Windows resolved the name successfully, but the caller requested an operation or open mode that requires a data file and the target is a directory. The status is often associated with native create options such as FILE_NON_DIRECTORY_FILE.

Common programming causes

What to do

Record the final resolved path and the exact create/open options. If directories are valid inputs, open them with directory-appropriate flags and use directory enumeration or metadata APIs instead of file-data operations. If only a regular file is valid, reject the configuration or command-line value before issuing the native request.

The inverse case is STATUS_NOT_A_DIRECTORY: there the caller expected a directory but the existing target is a regular file. Treating these statuses separately makes path-validation bugs much easier to diagnose.

See NtCreateFile, File-system open processing, and the SMB2 CREATE specification.


Looking for a different code? Search another status or error code.

Exit mobile version